I have recently learned about:
// cppcheck-suppress noExplicitConstructor
A(int a)
{
std::cout << a;
}
to make cppcheck ignore some things I don't want to consider errors/warnings. However, I also depend on this style Doxygen comments:
/** This is A's constructor. */
A(int a)
{
std::cout << a;
}
I tried to do this:
/** This is A's constructor.
* cppcheck-suppress noExplicitConstructor
*/
A(int a)
{
std::cout << a;
}
but cppcheck doesn't pick up that suppression. Is there anyway to embed a cppcheck suppression in a Doxygen-style comment?
(For the previous versions see the edit history.)
This works for me:
class X {
public:
/** a very ugly constructor */
// cppcheck-suppress uninitvar
X() { int a; a++; }
};
Now doxygen will correctly see "a very ugly constructor" and cppcheck (installed just for this purpose) with command-line option --inline-suppr suppresses the warning "(error) Uninitialized variable: a".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With