Version: Developer Edition v10.6 (92116)
Deployed with Jenkins running in docker
Build by MCUXpresso running in docker
I have a project that is 31% C++ and 69% C code. I want to analyse it using the MISRA ruleset. I’ve set up the project and run the analysis, however it seems like it is using both the MISRA C++ and MISRA C rules on all files. How do I specify that the MISRA C++ should only be used on .cpp files and the MISRA C should only be used on .c files?
Each C++ source file is identified as C++, each C file is identified as C, and each header file is one or the other or both, depending on where it is included. Each rule also specifies if it applies to C, C++, or both.
For MISRA, we have many rules that target both C and C++:
Some rules were almost identical in MISRA C and MISRA C++, we only implemented them once, targeting both languages
Some rules may only exist in one MISRA version, but we thought they also made sense for the other language, so we also decided to target both.
We believe the current user experience is the most interesting one if your goal is to have the best code possible: You benefit from all rules that make sense, no matter where they were initially written.
If your goal is to formally validate the compliance of your code with MISRA, we understand this might not be what you expected. We are not, for now, a tool that targets strict MISRA compliance.