Cppcheck 内联抑制不起作用

Cppcheck inline suppression not working

示例代码:

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

Cppcheck 调用:

$ 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.

如何抑制这个错误?

这样:

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

它需要 --inline-suppr 作为命令行参数。