Main Content

MISRA C Compliance Considerations

R2026b
MISRA C:2012 and MISRA C:2023 compliance, including modeling style, block usage, and configuration settings

These high-integrity modeling guidelines help you to model your system with the intent of improving the likelihood of generating code that complies with the MISRA C:2012 and MISRA C:2023 coding standards. Use the Model Advisor checks for these guidelines, as well the Model Advisor Checks for MISRA C Coding Standards (Simulink Check), to verify your model.

Modeling Guidelines

expand all

hisl_0032: Model element namesNaming conventions for model elements that produce valid identifiers in generated code
hisl_0061: Unique identifiers for clarityUse unique identifiers for signals and across scopes within a chart
hisl_0062: Global variables in graphical functionsUse of data with a global scope in graphical functions
hisl_0063: Length of user-defined object names to improve MISRA C complianceLimit the length of user defined names
hisl_0020: Blocks not recommended for MISRA C complianceImprove MISRA C:2012 and MISRA C:2023 compliance of the generated code
hisl_0101: Prevent operations that result in dead logic to improve code complianceAvoid operations that result in dead logic in the model (Since R2022a)
hisl_0102: Data type of loop control variables to improve MISRA C complianceUse integer data type for loop control counter variables
hisl_0060: Configuration parameters that improve MISRA C complianceSet model configuration parameters to improve MISRA C:2012 and MISRA C:2023 compliance of generated code
hisf_0065: Type cast operations in Stateflow to improve code complianceProtect against Stateflow implicit data type casting for integer and fixed-point calculations to data types other than input data types
hisf_0211: Protect against use of unary operators in Stateflow Charts to improve code complianceImprove code compliance of the generated code