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.

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 — Current Edition

The 2023 edition consolidates all previous versions (MISRA C:2012 + Amendments 1–4 + Technical Corrigenda) into a single, comprehensive standard. Key updates include:

UpdateDescription
C11/C18 supportGuidelines for _Atomic, _Static_assert, anonymous structs/unions
Concurrency rulesNew guidelines for multithreading and atomic operations — critical for RTOS-based embedded
Security focusEnhanced alignment with CWE, CERT C, and CRA requirements
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 constructsgoto, 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 26262AutomotiveRecommends MISRA C for ASIL A–D
IEC 61508IndustrialRecommends restricted C subset
DO-178CAerospaceCoding standards required (MISRA commonly used)
IEC 62304MedicalRequires documented coding standards
EN 50128RailwayRecommends restricted language subset
  • CRA — The EU Cyber Resilience Act requires secure development practices; MISRA C provides the implementation framework.
  • 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.

Related Terms