Skip to content
Inovasense

MISRA C

MISRA C — Coding guidelines for safe, reliable C software in embedded and safety-critical systems. 2023 edition supports C11/C18.

Definition
MISRA C — Coding guidelines for safe, reliable C software in embedded and safety-critical systems. 2023 edition supports C11/C18.

MISRA C — Safe Coding for Embedded Systems

MISRA C is a set of coding guidelines developed by the Motor Industry Software Reliability Association (MISRA) to ensure safety, security, and reliability of C code in embedded systems. Originally created for the automotive industry, MISRA C is now the de facto standard across aerospace, medical devices, industrial control, rail, and any domain where software failure has safety or security consequences.

MISRA C:2023 and MISRA C:2025

The 2023 edition (MISRA C:2012 Third Edition, Second Revision) consolidates MISRA C:2012 with Amendments 1–4 and Technical Corrigenda 1–2 into a single document. MISRA C:2025, an incremental update published in March 2025, is the current edition. Key 2023 updates include:

UpdateDescription
C11/C18 supportGuidelines for _Generic, _Noreturn, _Alignas, atomics and threads
Concurrency rulesNew guidelines for multithreading and atomic operations — critical for RTOS-based embedded
Security focusPublished coverage mappings against CERT C and ISO/IEC 17961 (a CWE mapping was added with MISRA C:2025)
Unified documentAll amendments and corrigenda merged into one specification

Guideline Classification

CategoryMeaningDeviation Allowed?
MandatoryMust be followed — no exceptions❌ Never
RequiredMust be followed unless formally deviated✅ With documented rationale
AdvisoryRecommended best practice✅ No formal deviation needed

Guidelines are further classified as Rules (precisely defined, tool-checkable) or Directives (broader, require engineering judgment).

What MISRA C Prevents

Common C-language pitfalls that MISRA C guards against:

  • Undefined behavior — Signed integer overflow, uninitialized variables, null pointer dereference
  • Implementation-defined behavior — Bit-field ordering, char signedness, struct padding
  • Dangerous constructs — goto, setjmp/longjmp, unions for type-punning, recursive functions
  • Security vulnerabilities — Buffer overflows, format string attacks, integer truncation
  • Concurrency bugs — Data races, non-atomic operations on shared variables

Compliance in Practice

AspectApproach
Static analysis toolsPC-lint, Polyspace, Coverity, Parasoft, LDRA, QA-C
CI/CD integrationAutomated MISRA checking on every commit
Deviation processFormal deviation record with safety impact analysis
Compliance matrixMapping of MISRA rules to project rules with violation tracking

MISRA C + Functional Safety Standards

MISRA C compliance is referenced or implied by major safety standards:

StandardDomainMISRA Requirement
ISO 26262AutomotiveRequires coding guidelines; cites MISRA C as an example for C
IEC 61508IndustrialRecommends restricted C subset
DO-178CAerospaceCoding standards required (MISRA commonly used)
IEC 62304MedicalRequires documented coding standards
EN 50716 (supersedes EN 50128)RailwayRecommends restricted language subset
  • CRA — The EU Cyber Resilience Act requires products to be designed and developed for appropriate cybersecurity but names no coding standard; MISRA C is one way to support this for C code.
  • RTOS — MISRA C:2023’s new concurrency guidelines are essential for RTOS-based multi-threaded firmware.

All our embedded projects follow MISRA C guidelines with automated static analysis in CI/CD. See our Embedded Systems Development services.

Official References

Related Terms