I want to suppress error/warnings from a 3rd party library header. It seems like this is possible to do from what I have read online. I do so using the following in my project file:
I had the same issue with suppressions in projectfiles. I've ended up writing some scripts to parse the suppression out of the .cppcheck file and into a seperate suppression.xml. In the gui the .cppcheck file with suppressions seem to work fine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to suppress error/warnings from a 3rd party library header. It seems like this is possible to do from what I have read online. I do so using the following in my project file:
<suppressions>
<suppression filename="*\include\ThirdParty\*">uninitMemberVar</suppression>
</suppressions>
I run this using:
"c:\Program Files\Cppcheck\cppcheck.exe" --enable=all --std=c++03 --project=MyProj.cppcheck myFile.cpp
This works in suppressing the uninitMemberVar warning in my 3rd party header file. However it supresses the same warning in my code as well.
myFile.cpp
include "myFile.h"
...
myFile.h
include "ThirdParty/header.h"
...
Without the suppression above, I get:
...\ThirdParty\header.h:705:5: warning: Member variable 'XXX' is not initialized in the constructor. [uninitMemberVar]
myFile.h:184:5: warning: Member variable 'YYY' is not initialized in the constructor. [uninitMemberVar]
With the suppression, I expect to get the second warning but not the first. However I get neither.
Is this expected? Am I doing something wrong?
This is still an issue for me. Anyone have any idea why suppression specified to third party header file also applies to my code file.
I had the same issue with suppressions in projectfiles. I've ended up writing some scripts to parse the suppression out of the .cppcheck file and into a seperate suppression.xml. In the gui the .cppcheck file with suppressions seem to work fine