MISRA C Support in MATLAB and Simulink

To help assess the quality of software code used in electronic control units, the MISRA Consortium introduced guidelines for using C code in software running in automobiles and aircraft. In 1998, MISRA Ltd. published MISRA C (MISRA C:1998) to provide a restricted subset of a standardized, structured language that met Safety Integrity Level (SIL) 2 and higher.

MISRA C has evolved through MISRA C:2004, MISRA C:2012 and its amendments and technical corrigenda, MISRA C:2023, and MISRA C:2025. MISRA C:2025, published in March 2025, is the current version and supersedes the 2023, 2019, 2012, 2004, and 1998 editions. Related standards include MISRA AC AGC for automatically generated C code and MISRA C++:2023 for C++17 projects.

For more information about MISRA C, see misra.org.uk

Simulink, Stateflow, and Embedded Coder are widely used to generate embedded software for MISRA C®. Polyspace® code verification products are used to analyze handwritten or generated code for MISRA C compliance. Polyspace Bug Finder supports the detection of MISRA-C: 2004, MISRA-C++:2008, MISRA C:2012, MISRA C:2023, MISRA C:2025, and MISRA AC AGC coding rules.

Continental Develops Electronically Controlled Air Suspension for Heavy-Duty Trucks

Continental traced requirements to design specifications, modeled and simulated the air suspension, and generated production code.

You can configure a model or subsystem so that the code generator is most likely to produce MISRA C compliant code using the Code Generation Advisor. The generated code can be checked for MISRA compliance using Polyspace, and the results can be traced back to the model. You can annotate at the model level to provide justifications for any deviations.

Learn more about generating code that complies with MISRA:

To assist users further in their efforts to achieve MISRA C compliance, MathWorks provides MISRA Support Table using Embedded Coder with Simulink and Stateflow models.

The MISRA C analysis package includes:

  • Documentation with rules summary and detailed examples
  • Simulink models

Key products for developing MISRA C applications: