Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

addon support? MISRA, CERT, etc. #107

Open
dvdsosa opened this issue Oct 19, 2020 · 2 comments
Open

addon support? MISRA, CERT, etc. #107

dvdsosa opened this issue Oct 19, 2020 · 2 comments

Comments

@dvdsosa
Copy link

dvdsosa commented Oct 19, 2020

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.

@AntonKrug
Copy link
Collaborator

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

@HomoHabilis
Copy link

HomoHabilis commented Apr 13, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants