MISRA Discussion Forums
Use a subset of MISRA Rules - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: General Questions (https://forum.misra.org.uk/forumdisplay.php?fid=27)
+--- Thread: Use a subset of MISRA Rules (/showthread.php?tid=1503)



Use a subset of MISRA Rules - gauthamkrishnan.r - 23-08-2019

Can I use only a subset of the MISRA C:2012 Guidelines for my project?


Re: Use a subset of MISRA Rules - misra-c - 07-10-2019

The use of a MISRA C:2012 subset will depend on whether the project wishes to make claim of MISRA compliance.
  • MISRA compliance will not be claimed
    The project may choose a subset, but should consider the category of the guideline.
  • MISRA compliance will be claimed
    The project must follow the requirements specified for the category of the guideline. This is discussed below.

Section 6 of the MISRA C:2012 Guidelines explains the difference between Mandatory, Required and Advisory categories.

All guidelines should be applied by the project, but there are differences in how violations of the guidelines may be handled.

A short summary is that:
  • Mandatory Guidelines: Violations are never permitted
  • Required Guidelines: Violations are not permitted unless supported by a formal deviation
  • Advisory Guidelines: These are recommendations which should be followed as far as practical. Violations are identified, but the project may decide how to handle them. They may be "disapplied" if MISRA Compliance:2016 is adopted.

MISRA published a document in April 2016, which includes a more detailed discussion of this topic.
"MISRA Compliance:2016 Achieving compliance with MISRA Coding Guidelines"
The document can be found by clicking on the above link or by looking either in the "Resources" section of the Bulletin Board or the Publications section of the MISRA web site.


Re: Use a subset of MISRA Rules - gauthamkrishnan.r - 02-12-2020

So for my project, I choose to apply a subset of only 70 Rules out of the 156 total Rules available. If I ensure those 70 Rules aren't violated, can I claim compliance to MISRA?


RE: Use a subset of MISRA Rules - misra-c - 13-02-2022

As stated above, to conform with the requirements of MISRA Compliance, and to claim that you are compliant, you must (as a minimum):
  • Comply with all [16] of the Mandatory Guidelines
  • Comply with all [108] of the Required Guidelines - or have a Deviation to cover any violations

You may, with appropriate justification, disapply Advisory Guidelines - but you CANNOT disapply any Required or Mandatory Guidelines.

Therefore, if you are only checking 70 Guidelines, you would NOT be compliant.