问题
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?
回答1:
This way:
class Foo {
// cppcheck-suppress noExplicitConstructor
Foo(int foo) { }
};
It requires --inline-suppr as command line argument.
来源:https://stackoverflow.com/questions/37701104/cppcheck-inline-suppression-not-working