MISRA-C is a set of software development guidelines for the C programming language published by MISRA (the Motor Industry Software Reliability Association). MISRA is a collaboration between vehicle manufacturers, component suppliers, and engineering consultancies that promotes best practice in developing safety-related electronic systems in road vehicles and other embedded systems.
Scope and Language Subset
The guidelines define a subset of the C language intended to be suitable for critical embedded systems. Rather than promoting the use of C itself, MISRA-C seeks to enable its safest possible use by restricting language constructs known to be insecure, ambiguous, or implementation-defined. The 2004 edition is based on ISO/IEC 9899:1990 (C90) as amended by COR1:1995, AMD1:1995, and COR2:1996, and targets a “free-standing environment” typical of embedded automotive applications.
| Attribute | Specification |
|---|---|
| Base language standard | ISO/IEC 9899:1990 (C90) with amendments |
| Target environment | Free-standing (embedded) systems |
| Total rules (2004 edition) | 142 |
| Compliance claim | Per product, not per organisation |
Rule Categories and Classification
The guidelines are organised into categories covering environment, language extensions, types, declarations, expressions, control flow, functions, pointers, preprocessing directives, standard libraries, and run-time failures. Each rule is classified as either required or advisory.
| Classification | Count | Requirement |
|---|---|---|
| Required | 122 | Mandatory; deviations must be formally raised, justified, and documented |
| Advisory | 20 | Should be followed as far as reasonably practical; formal deviations are optional |
Claiming Compliance
Compliance can be claimed only for a specific product. A claim requires that all code is compliant with the rules or subject to documented deviations, that a compliance matrix demonstrates how each rule is enforced (via static analysis tools, manual review, or other means), and that supporting processes, such as tool validation, training, and style guidance, have been addressed. The use of static checking tools to enforce compliance is strongly encouraged.
Leave a Reply