Hauptinhalt

MISRA C – Compliance-Erwägungen

R2026b
MISRA C:2012 und MISRA C:2023 Compliance, einschließlich Modellierungs-Style, Block-Verwendung, und Konfigurationseinstellungen

Diese Anleitungen zur Modellierung mit hoher Integrität erleichtern es Ihnen, Ihr System so zu modellieren, dass mit höherer Wahrscheinlichkeit Code gemäß dem Programmierstandard MISRA C:2012 und MISRA C:2023 generiert wird. Verwenden Sie die Model Advisor-Prüfungen für diese Anleitungen sowie den Model Advisor Checks for MISRA C Coding Standards (Simulink Check), um Ihr Modell zu überprüfen.

Richtlinien zur Modellierung

alle erweitern

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 (Seit 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