10

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?

chtenb
  • 14,924
  • 14
  • 78
  • 116

1 Answers1

10

This way:

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

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

Løiten
  • 3,185
  • 4
  • 24
  • 36
orbitcowboy
  • 1,438
  • 13
  • 25