I'm having some troubles trying to suppress specific CERT-C rules using the cert.py addon in cppcheck 2.6.
Right now I'm able to successfully run cppcheck with both misra.py and cert.py. I am able to configure the MISRA addon to ignore multiple rules. With that said, I am having difficulties disabling CERT-C rules in a similar fashion.
Thank you very much for the quick reply! I believe my confusion was surrounding what suppression arguments should be specified in the .json file versus the CLI call. Your example works wonderfully.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm having some troubles trying to suppress specific CERT-C rules using the cert.py addon in cppcheck 2.6.
Right now I'm able to successfully run cppcheck with both misra.py and cert.py. I am able to configure the MISRA addon to ignore multiple rules. With that said, I am having difficulties disabling CERT-C rules in a similar fashion.
I'm running the following line:
I'm able to successfully "ignore" all instances of specific MISRA warnings with the following misra.json:
With that said, I cannot seem to do the same with my CERT-C equivalent cert.json:
Where I get the following error:
I tried digging through the documentation pdf, --help, and cppcheck forums, but cannot seem to find a solution. Thus, my questions are:
Thank you!
-Richard
as you saw, the
--suppress-rules
option is only available in misra.a solution that works for all addons, including misra, is to use
--suppress
or--suppressions-list
on the cppcheck command line.Last edit: Daniel Marjamäki 2021-11-12
Thank you very much for the quick reply! I believe my confusion was surrounding what suppression arguments should be specified in the .json file versus the CLI call. Your example works wonderfully.