cppcheclipse icon indicating copy to clipboard operation
cppcheclipse copied to clipboard

addon support? MISRA, CERT, etc.

Open dvdsosa opened this issue 5 years ago • 2 comments

Hello,

It would be nice to have a checkbox to enable the --addon=misra --addon=cert to cppcheclipse.

Otherwise, you could indicate where the users can add this command line parameter to the call to cppcheck.

Have a nice day! David.

dvdsosa avatar Oct 19 '20 14:10 dvdsosa

That is great idea, I will try to have a look at it

AntonKrug avatar Dec 02 '20 11:12 AntonKrug

I enabled it by adding in the Project Properties -> cppcheclipse - > Advanced Settings -> Advanced command line arguments: --inline-suppr --addon="C:\Program Files\Cppcheck\addons\misra.json" If the path is different modify accordingly. Add the 3 files below to the folder addons (should be at: "C:\Program Files\Cppcheck\addons", if your path is different, modify the json file accordingly) Remove the extension ".txt" from the file (json files are not accepted on github comments). misra.json.txt

You have to provide your own rule file, the one attached below is just an example for formatting. misra_c_2012.txt

Still as of cppcheck 2.4 the latest misra.py included in the release has an issue with rules 9.x, that blocks the checks. Here is an alternate py file with those rules disabled. Remove the extension ".txt" from the file (py files are not accepted on github comments). misra.py.txt

Provided you have set the correct paths you should see the MISRA warnings along with the other cppcheck warnings.

HomoHabilis avatar Apr 13 '21 15:04 HomoHabilis