|This article relies on references to primary sources. (January 2011)|
MISRA C is a software development standard for the C programming language developed by MISRA (Motor Industry Software Reliability Association). Its aims are to facilitate code safety, portability and reliability in the context of embedded systems, specifically those systems programmed in ISO C. There is also a set of guidelines for MISRA C++.
However, there are now more MISRA users outside of the automotive industry than in it: "MISRA has evolved as a widely accepted model for best practices by leading developers in sectors including aerospace, telecom, medical devices, defense, railway, and others."
The first edition of the MISRA C standard, "Guidelines for the use of the C language in vehicle based software", was produced in 1998, and is officially known as MISRA-C:1998.
In 2004, a second edition "Guidelines for the use of the C language in critical systems", or MISRA-C:2004 was produced, with many substantial changes to the guidelines, including a complete renumbering of the rules.
As of 18th March 2013, the release of MISRA C:2012 was announced. MISRA C:2012 extends support to the C99 version of the C language (while maintaining guidelines for C90), in addition to including a number of improvements that can reduce the cost and complexity of compliance, whilst aiding consistent, safe use of C in critical systems.
MISRAC stands for "Motor Industry Software Reliability Association" C standards.
MISRA-C:1998 had 127 rules, of which 93 were required and 34 were advisory; the rules were numbered in sequence from 1 to 127.
The MISRA-C:2004 document contains 142 rules, of which 122 are "required" and 20 are "advisory"; they are divided into 21 topical categories, from "Environment" to "Run-time failures".
The rules can be divided logically into a number of categories:
- Avoiding possible compiler differences, for example, the size of a C integer may vary but an INT16 is always 16 bits. (C99 standardized on
- Avoiding using functions and constructs that are prone to failure, for example,
- Produce maintainable and debuggable code, for example, naming conventions and commenting.
- Best practice rules.
- Complexity limits.
While there exist many software tools that claim to check code for "MISRA conformance", there is no MISRA certification process.
An exemplar suite for MISRA-C:2004 is available from the MISRA Forum, which allows tool users to evaluate and compare the checking support provided by the various MISRA tools. Additionally, it gives tool implementors some guidance as to the intent of the Rules within MISRA-C:2004.
- Notable tools that check code for MISRA conformance are
- Coverity Static Analysis
- ECLAIR by BUGSENG
- GrammaTech CodeSonar
- Klocwork Insight & Inspect
- LDRA Testbed by Liverpool Data Research Associates
- Parasoft C/C++test
- PC-Lint by Gimpel Software
- Polyspace by MathWorks
- PRQA/Programming Research's QA·C
- Understand by SciTools
- Sonar (software quality) by SonarSource (Open Source with some commercial plug-in components).
- C compilers that support MISRA conformance are
See also 
||This article has an unclear citation style. (September 2009)|
- Official website
- "Introduction to MISRA C". embedded.com.
- "MISRA C: Safer Is Better". electronicdesign.com.
- "MISRA C — Some key rules to make embedded systems safer". iar.com.
- "Commentary on the first edition of the MISRA C guidelines". knosof.co.uk.
- "Automating Compliance to MISRA C/C++ Standards". johndayautomotivelectronics.com.
- "New Version of MISRA C: Why Should You Care?". http://electronicdesign.com.
- "MISRA C:2012 release date announced". http://www.misra.org.uk.
- "MISRA C:2012: Plenty Of Good Reasons To Change". http://electronicdesign.com.
- "MISRA C:2012 fact sheet". http://www.programmingresearch.com.
- "MISRA C:2012 ensures automotive software safety". http://www.automotive-eetimes.com/.