11-04-2014, 07:44 AM
The MISRA-C Guidelines recognise that, in some situations, it is unreasonable or even impossible to comply with a coding rule and that it is necessary to deviate. Your example of casting an integer to a pointer is a situation where a deviation would be reasonable.
It is important that such deviations are properly recorded and authorized. The deviation procedure should be formalized within the software development process. No process is imposed by MISRA C because methods used will vary between organizations, for example:
It is important that such deviations are properly recorded and authorized. The deviation procedure should be formalized within the software development process. No process is imposed by MISRA C because methods used will vary between organizations, for example:
- * The physical methods used to raise, review and approve a deviation;
* The degree of review and evidence required, which may vary according to the guideline in question, before a deviation can be approved.
- * The guideline being deviated;
* The circumstances in which the deviation is permitted;
* Justification for the deviation, including an assessment of the risks associating with deviating compared with other possibilities;
* Demonstration of how safety is assured, for example a proof that an unsafe condition cannot occur, together with any additional reviews or tests that are required;
* Potential consequences of the deviation and any mitigating actions that have been taken.
Posted by and on behalf of the MISRA C Working Group