MISRA Discussion Forums

Full Version: How to deal mandatory rules in the MISRA compliance 2016?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm reviewing code based on the MISRA compliance 2016, and want to know interpretation of mandatory rules in the adopted code.
In MISRA compliance 2016, violate mandatory rules must not be permitted, but "non-compliant adopted code" is reasonable to deviate the rules.
Should I fix the code pointed out by mandatory rules, or need not ?
It is never acceptable for a project to contain violations of any guideline that MISRA has classified as "Mandatory" within one of its subsets (e.g. MISRA C:2012). Any violation of a Mandatory guidelines is likely to indicate a real issue, which is why MISRA does not allow a deviation to be used to cover any non-compliance.

If the use of adopted code within a project results in the violation of a Mandatory guideline, then management of that violation will depend on the cause:

1) If it is due to an interaction with the project's native code, then the native code should be modified to remove the violation.

2) If it is due to an issue within the adopted code itself, then the author of the adopted code should be advised of the issue and a request made to have it modified to eliminate the violation.

The "non-compliant adopted code" deviation reason (and the other reasons) may only be considered for non-compliance with a guideline that MISRA has classified as Required.
Thank you for your reply.
I understood that we must never not violate mandatory rules even if they are a part of adopted code.