I'm running cppcheck with a compile_commands file, a couple of suppressions and plist output (for usage with ericsson codechecker). The problem I'm experiencing is that plist entries are generated for the findings that are suppressed, even though that the suppressed findings are not displayed in the cli output. Am I missing something, or is this expected behavior / bug?
Hi again, thanks for the reply. I'm using cppcheck 2.5 from Fedora dnf repos. In my case, it's actually both the misra and core warnings which I have suppressed that still show up in the plist files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not sure what to ask. It would help with some reduced example that reproduces the problem..
can you reproduce if you check a single file.. and can the file be reduced somehow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes sorry, I was short on time. I did some more investigating and it seems like the suppressed errors that I'm getting are actually from the directories I've ignored. As you can see on the command I ran from my initial post, it includes -i$(pwd)/external. However, I'm still getting errors from my external directories. I figured this was due to using ignore (-i) option combined with --project which then in turn will make cppcheck not respect the paths you want to ignore. But now I'm noticing that all my errors which are of the suppressed type, are also from the external directories. It seems like cppcheck is in fact suppressing some of my false positives, but not on the path that I want to ignore.
To summurize:
- This might be a bug or not, but the -i option does not seem to ignore paths when combining with a compile_commands.json project (I tried both with and without pwd in the ignore path)
- Supressed errors are showing up for the "ignored" paths but not on the paths which are not ignored (in conjunction with a compile_commands.json project file)
Last edit: Tofik Sonono 2021-08-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your that, that did indeed remove all the errors from the ignored paths, and no more suppressed errors appear as well. Everything seems to work now.
I did however notice that suppression do still appear when running cppcheck in multithreaded mode, e.g when I run the command I posted in my initial post in multithreaded (without pwd and adding -j12 or -j2) will still generate suppressed errors (not in ignored paths). Just wanted to bring that to light.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm running cppcheck with a compile_commands file, a couple of suppressions and plist output (for usage with ericsson codechecker). The problem I'm experiencing is that plist entries are generated for the findings that are suppressed, even though that the suppressed findings are not displayed in the cli output. Am I missing something, or is this expected behavior / bug?
Best regards,
Tofik
Last edit: Tofik Sonono 2021-08-04
Sorry for delayed reply. I do not think it is by intention. Sounds like a bug.
hmm.. I fail to reproduce. What cppcheck version do you have.
I tried this in cppcheck repo:
If I remove the
--suppress=missingOverride
then the plist file contains lots of those warnings.Is it misra warnings that are not suppressed or the "core" cppcheck warnings also?
Hi again, thanks for the reply. I'm using cppcheck 2.5 from Fedora dnf repos. In my case, it's actually both the misra and core warnings which I have suppressed that still show up in the plist files.
Not sure what to ask. It would help with some reduced example that reproduces the problem..
can you reproduce if you check a single file.. and can the file be reduced somehow.
Yes sorry, I was short on time. I did some more investigating and it seems like the suppressed errors that I'm getting are actually from the directories I've ignored. As you can see on the command I ran from my initial post, it includes
-i$(pwd)/external
. However, I'm still getting errors from my external directories. I figured this was due to using ignore (-i) option combined with--project
which then in turn will make cppcheck not respect the paths you want to ignore. But now I'm noticing that all my errors which are of the suppressed type, are also from the external directories. It seems like cppcheck is in fact suppressing some of my false positives, but not on the path that I want to ignore.To summurize:
- This might be a bug or not, but the
-i
option does not seem to ignore paths when combining with a compile_commands.json project (I tried both with and without pwd in the ignore path)- Supressed errors are showing up for the "ignored" paths but not on the paths which are not ignored (in conjunction with a compile_commands.json project file)
Last edit: Tofik Sonono 2021-08-14
The behavior has changed a little bit.
Output with cppcheck-2.4:
Output with cppcheck-2.5:
With cppcheck-2.5 you should ignore the relative path.
Thanks for your that, that did indeed remove all the errors from the ignored paths, and no more suppressed errors appear as well. Everything seems to work now.
I did however notice that suppression do still appear when running cppcheck in multithreaded mode, e.g when I run the command I posted in my initial post in multithreaded (without pwd and adding -j12 or -j2) will still generate suppressed errors (not in ignored paths). Just wanted to bring that to light.