Using static code analysis to ensure MISRA compliance
For those involved with developing C or C++ code to meet any of the MISRA guidelines, the task of diagnosing violation reports from a static code analysis (SCA) tool should be a frequent one. Those who want to claim “guru” status might claim that they can develop MISRA compliant code first try, but most muggle developers (myself included) will rely upon a tool to check their code against the strict, yet relevant MISRA coding guideline(s).
Due to licensing issues, most (probably all?) SCA tools have only been able to provide a MISRA rule number and a referral to the official MISRA documentation for any reported MISRA violations which has required a physical or digital copy of the correct guideline at hand.
The help in Klocwork for reported violations has always been very useful and has taught me a great deal about C and C++ (as I am sure it has many other users) but Klocwork included, has always provided a kind message referring you to the official MISRA guidelines.
But now, behold, Klocwork 2016.3, Rogue Wave Software have introduced full MISRA documentation for their suite of certified MISRA checkers.
What might possibly be seen as a small step for Klocwork should be seen as a significant time saver for teams using Klocwork to ensure compliance with MISRA.
An uncountable number of times have I been at an office, presented with Klocwork reports for MISRA violations, rummaging around for a copy of the MISRA guideline to ultimately reach the conclusion that no copies were found or an older version of the C standard was lying around somewhere.
Alas, the hunt for MISRA documentation has been frustrating, yet no more (thanks to Klocwork), and I am strangely excited about reviewing some MISRA issues now to access this in-tool help.
Thanks for reading and happy coding!
Jacob – Technical Consultant, Emenda
PS – If you are currently not using SCA tools to aid MISRA-compliance then I strongly suggest it, and Klocwork is a fine choice.
Just get in touch with us at [email protected]