Main Content

Check safety-related code generation settings for code style

Check ID: mathworks.hism.hisl_0047

Check model configuration for code generation settings that can impact safety.


This check verifies that model configuration parameters for code generation are set optimally for a safety-related application.

Available with Simulink® Check™.

Results and Recommended Actions

ConditionRecommended Action
The option that specifies the style for parenthesis usage is set to Minimum (Rely on C/C++ operators precedence) or to Nominal (Optimize for readability). For safety-related applications, explicitly specify precedence with parentheses. Set parameter ParenthesesLevel to Standards(Parentheses for Standards Compliance) or Maximum(Specify precedence with parentheses).
The option that specifies whether to preserve operand order is cleared. This option increases the traceability of the generated code.Set parameter PreserveExpressionOrder to on.

Action Results

Clicking Modify Settings configures model code generation settings that can impact safety.

Subchecks depend on the results of the subchecks noted with D in the results table in the Model Advisor window.

Capabilities and Limitations

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

  • Does not highlight parameter names in report without Embedded Coder®.

See Also