hisl_0063: Length of user-defined object names to improve MISRA C compliance
R2026bLimit the length of user defined names
Usage: High-Integrity System Modeling
Guideline ID: hisl_0063
Prerequisite: hisl_0060: Configuration parameters that improve MISRA C compliance
Rules
To improve MISRA C:2012 and MISRA C:2023 compliance of generated code, use configuration
parameter Maximum identifier length (MaxIdLength) to
limit the length of user defined names.
Note
The default of Maximum identifier length is
31.
| hisl_0063: Length of user-defined object names to improve MISRA C compliance | |
|---|---|
| A | For Subsystem blocks with parameter
Function name options set to Rationale Length in the generated code can result in a MISRAC:2012 and MISRA C:2023 violation. Verification Check for length of user-defined object names (Simulink Check) Example You can limit the function name to the length equal to or less than the specified value using Code mappings. This can be used to avoid violation of MISRA rules.
|
| B | Limit the length of data object names to be equal to or less than the value specified in Maximum identifier length:
Rationale Length in the generated code can result in a MISRAC:2012 and MISRA C:2023 violation. Verification Check for length of user-defined object names (Simulink Check) |
| C | When using these storage classes, limit the length of signal and parameter names to be equal to or less than the value specified in Maximum identifier length:
Note If specified, this includes the length of the Identifier name.
Rationale Length in the generated code can result in a MISRAC:2012 and MISRA C:2023 violation. Verification Check for length of user-defined object names (Simulink Check) |
Tips
When using a service Interface configuration, identifiers derived from expansion tokens (e.g., $R, $X, etc.) can exceed the maximum identifier length.
Industry Standards
ISO 26262-6, Table 6 (1d) – No multiple use of variable names
DO-331, Section MB.6.3.2.e – 'Low-level requirements conform to standards'
DO-331, MB.6.3.3.e 'Software architecture conforms to standards'
MISRA C:2012, Rule 5.1
MISRA C:2012, Rule 5.2
MISRA C:2012, Rule 5.3
MISRA C:2012, Rule 5.4
MISRA C:2012, Rule 5.5
MISRA C:2023, Rule 5.1
MISRA C:2023, Rule 5.2
MISRA C:2023, Rule 5.3
MISRA C:2023, Rule 5.4
MISRA C:2023, Rule 5.5
