I'm wondering why cppcheck has chosen comments to specify the inline suppressions.
In particular why this was chosen over #pragma or _Pragma approaches which are use by other tools/compilers.
In particular I'm currently preparing some macros to annotate our source code, such that we can use it to suppress both compiler and coverity warnings (using macros to deal with compiler specific pragmas).
I would like to extend this to also suppress certain issues in cppcheck, but unfortunately this does not worked, since the comments are processed/stripped before the c preprocessing step (as such I cannot inject a cppcheck suppression comment using a macro).
To understand how much I should invest in this, I'd like to understand the reasoning for the cppcheck design choices, and whether you think it might be doable to adapt cppcheck to handle inline suppression with pragmas.
Hi,
I'm wondering why cppcheck has chosen comments to specify the inline suppressions.
In particular why this was chosen over #pragma or _Pragma approaches which are use by other tools/compilers.
In particular I'm currently preparing some macros to annotate our source code, such that we can use it to suppress both compiler and coverity warnings (using macros to deal with compiler specific pragmas).
I would like to extend this to also suppress certain issues in cppcheck, but unfortunately this does not worked, since the comments are processed/stripped before the c preprocessing step (as such I cannot inject a cppcheck suppression comment using a macro).
To understand how much I should invest in this, I'd like to understand the reasoning for the cppcheck design choices, and whether you think it might be doable to adapt cppcheck to handle inline suppression with pragmas.
Example:
Thanks,
Pim