16

Are there any open-source or free tools out there, that check the MISRA C compliance?

orbitcowboy
  • 1,438
  • 13
  • 25
Vladimir Keleshev
  • 13,753
  • 17
  • 64
  • 93

2 Answers2

14

Cppcheck (free and open source) has an official addon allowing to check MISRA-C 2012 rules.

The way to do so:

  1. cppcheck --dump file.c
  2. python misra.py file.c.dump

You can simply find misra.py in your Cppcheck installation or here: https://github.com/danmar/cppcheck/blob/master/addons/misra.py

begarco
  • 751
  • 7
  • 20
  • 1
    Unfortunately, Cppcheck needs MISRA rules for this addon to work. These rules are not free and are not provided with Cppcheck. – TonioGA Dec 06 '19 at 06:53
  • 3
    Cppcheck does not need MISRA rules for this addon to work: if MISRA rules are providen users get full rules' message when an issue is found, otherwise users get only MISRA rules' id. – begarco Dec 07 '19 at 23:04
8

Relatively speaking, PC-Lint is virtually free when compared to full-blown static analysis tools with MISRA compliance checks. Furthermore, I have found that PC-Lint does a better job of reporting than those expensive (i.e. >$20,000) tools.

Throwback1986
  • 5,887
  • 1
  • 30
  • 22