MATLAB Answers

How do I check MISRA AC AGC rules with Polyspace?

15 views (last 30 days)
I have generated some C code using a code generator and I would like to check the code for its compliancy with MISRA AC AGC using Polyspace rules checker.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 16 Nov 2011
Polyspace already supports most of checkable MISRA AC AGC rules in R2011b. If you want to check C code for MISRA AC AGC compliance, you can use the template file 'MISRA_AC_AGC_2007_primary_Polyspace_set.txt':
1. Download and save the file 'MISRA_AC_AGC_2007_primary_Polyspace_set.txt' that you can find at the bottom of this Solution.
2. Open Polyspace Verifier Environment (PVE) with the project you want to apply the MISRA AC AGC rules.
3. Then Expand the "Compliance with Standard" category in the configuration window and enable "Check MISRA C rules".
4. Expand again "Check MISRA C rules" and choose “custom” from the drop-down list in the "MISRA C rules configuration" category.
5. Then click on the button near "-misra2" option and add the text file using the “Load an existing MISRA C rule configuration file” browse button.
6. Close the MISRA settings window using the 'OK' button and run the verification.
Note that depending on the distinct primary categories the rules are set in the following way:
1. OBL – warning (OBLigatory)
2. REC – warning (RECommended)
3. READ – off (READability)
4. NA – off (Not Applicable)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by