Author Topic: Cppchecker running addon MISRA  (Read 14532 times)

Offline Jewest

  • Multiple posting newcomer
  • *
  • Posts: 31
Cppchecker running addon MISRA
« on: March 09, 2018, 09:30:02 am »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cppchecker running addon MISRA
« Reply #1 on: March 09, 2018, 10:15:16 am »
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!]

Offline Jewest

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Cppchecker running addon MISRA
« Reply #2 on: March 09, 2018, 12:26:33 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cppchecker running addon MISRA
« Reply #3 on: March 09, 2018, 05:54:40 pm »
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!]

Offline Jewest

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Cppchecker running addon MISRA
« Reply #4 on: March 12, 2018, 08:33:00 am »
I'll see what I can do  ;)
As soon as I can find a spot I'll try and work on it.