Use this tag for questions about code that must conform to the coding guidelines called MISRA-C and MISRA-C++.
Document full titles:
- Guidelines for the use of the C language in critical systems
- Guidelines for the use of the C++ language in critical systems
Originally written by-and-for the automotive industry, now more widely used, including in the aerospace and defence industries.
Three editions of the C guidelines exist:
- MISRA-C:1998 - 1st Edition (informally MISRA C1).
Compatible with C90 only. - MISRA-C:2004 - 2nd Edition (informally MISRA C2).
Compatible with C90 only. - MISRA C:2012 - 3rd Edition (informally MISRA C3).
Released at Embedded World 2013. Compatible with C90 and C99.
An updated MISRA C:2012, 3rd Edition, 1st Revision (informally MISRA C3.1) was released at Embedded World 2019, incorporating Amendment 1 and Technical Corrigendum 1.
MISRA C:2012 Amendment 2 (published February 2020) brings C11 and C17 into scope (albeit with some restrictions).
MISRA C:2012 is the current industry de facto standard and the one recommended to use. The older ones are still available, but not recommended for new projects.
MISRA-C++ only exists in its current revision, MISRA-C++:2008.
Tag usage: Use this tag for all questions related to MISRA C and MISRA C++. It shall always be used together with either the c or the c++ tag.
When asking about the MISRA rules, please specify exactly which version you are using: C:1998, C:2004, C:2012 or C++:2008.