Cppcheck inline suppression not working
Asked Answered
D

1

13

Example code:

class Foo {
    // cppcheck-suppress noExplicitConstructor
    Foo(int foo) { }
}

Cppcheck call:

$ cppcheck.exe --enable=all foo.cpp
Checking foo.cpp...
[foo.cpp:3]: (style) Class 'Foo' has a constructor with 1 argument that is not explicit.

How can I suppress this error?

Dichromatism answered 8/6, 2016 at 11:23 Comment(0)
C
14

This way:

class Foo {     
// cppcheck-suppress  noExplicitConstructor     
 Foo(int foo) { } 
}; 

It requires --inline-suppr as command line argument.

Central answered 9/6, 2016 at 20:46 Comment(1)
Or setting the switch Enable inline suppressions in the GUI version.Eternalize

© 2022 - 2024 — McMap. All rights reserved.