News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Cppchecker running addon MISRA

Started by Jewest, March 09, 2018, 09:30:02 AM

Previous topic - Next topic

Jewest

Hello,

I am currently using the cppcheck plugin and was wondering if it would be possible to run the MISRA checker addon as well.
What I understand from the documentation of cppchecker chapter 12 is that I need to dump the files and then use the python check.
Can I integrate this in Code blocks in an easy way?

Best regards,

Jewest

oBFusCATed

It depends what changes in the invocation and the output of cppcheck. If it doesn't require changes to the parsing then it will be easy. But first you need to find how to run it then you could probably easily modify the plugin.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jewest

running it is easy.
command prompt:
cppchecker --logfile <directory>
python <path misra.py>/misra.py

example on my linux box:
cppcheck --dump ./src/
python /usr/bin/misra.py ./src/*.dump

checking the folder a lot of dump files are create, so I am guessing del *.dump would be in order once the data is processed

example output:
[src/deviceinformation.hpp:6] misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-20.1]

So I am guessing that by adding the rule file you can turn on an off the options.
If this works than C::B will have MISRA checking build in, making it a more powerfull tool.

oBFusCATed

Now you need to modify the cppcheck plugin to support this workflow.
Patches welcome. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jewest

I'll see what I can do  ;)
As soon as I can find a spot I'll try and work on it.