I am working with cppcheck version 2.4.1 + misra.py addon combined with --inline-suppr option for cppcheck. I am checking a boilerplate.c source code that haves 5 known misra violations.
I am able to generate the .dump file with the suppressions section, and next output is generated when misra.py parses the .dump file:
As can be seen, the rules violation dissapear (as expected) but the total count of violations remain up to 5 (expected to be 0).
I could review the misra.py code, and it seems that it is missing some check on the reportError() function. I could solve this (at least working in my environment) by adding an extra check (call to cppcheckdata.is_suppressed()) in that function:
Hi,
I am working with cppcheck version 2.4.1 + misra.py addon combined with --inline-suppr option for cppcheck. I am checking a boilerplate.c source code that haves 5 known misra violations.
I am able to generate the .dump file with the suppressions section, and next output is generated when misra.py parses the .dump file:
As can be seen, the rules violation dissapear (as expected) but the total count of violations remain up to 5 (expected to be 0).
I could review the misra.py code, and it seems that it is missing some check on the reportError() function. I could solve this (at least working in my environment) by adding an extra check (call to cppcheckdata.is_suppressed()) in that function:
With this the output become as expected:
No output, which means 'no violations'.
I'm sure it is not the best solution, but I want to share it with you just to let you know about this issue.
Thanks!
hmm looks pretty reasonable to me.