Main Content

Configuration Settings

hisl_0060: Configuration parameters that improve MISRA C:2012 compliance

ID: Titlehisl_0060: Configuration parameters that improve MISRA C:2012 compliance
Description

Set these model configuration parameters as specified:

  • System target file as an ERT-based target

  • Use division for fixed-point net slope computation to On or Use division for reciprocals of integers only.

  • Inf or NaN block output to warning or error.

  • Model Verification block enabling to Disable All

  • Undirected event broadcasts to error.

  • Wrap on overflow to warning or error.

  • Production hardware signed integer division rounds to to Zero or Floor

  • Compile-time recursion limit for MATLAB functions to 0.

  • Casting Modes to Standards Compliant.

  • Code replacement library to None or AUTOSAR 4.0

  • Maximum identifier length to the implementation dependent limit. The default is 31.

  • Parentheses level to Maximum (Specify precedence with parentheses)

  • Shared code placement to Shared location.

  • Standard math library to C89/C90 (ANSI) or C99 (ISO), depending on the toolchain.

  • Bitfield declarator type specifier to uint_T when any of these parameters are selected:

    • Pack Boolean data into bitfields

    • Use bitsets for storing state configuration

    • Use bitsets for storing Boolean data

Select (on) these configuration parameters:

  • Include Comments

  • MATLAB user comments

  • Preserve static keyword in function declarations (Select only when configuration parameter File packaging format is set to Compact or CompactWithDataFile.)

Deselect (off) these configuration parameters:

  • Shift right on a signed integer as arithmetic shift

  • Dynamic memory allocation in MATLAB functions

  • Enable run-time recursion for MATLAB functions

  • External mode

  • Generate shared constants

  • MAT-file logging

  • Replace multiplications by powers of two with signed bitwise shifts

  • Support complex numbers (Only if you do not need complex number support)

  • Support continuous time

  • Support non-finite numbers

  • Support non-inlined S-functions

  • Use dynamic memory allocation for model initialization (Keep this parameter selected only when configuration parameter Code Interface Packaging is set to Reusable Function.

RationaleImprove MISRA C:2012 compliance of the generated code.
Model Advisor Checks

For High-Integrity System Modeling, see Check configuration parameters for MISRA C:2012 (Simulink Check).

For Modeling Guidelines for MISRA C:2012, see Check configuration parameters for MISRA C:2012 (Simulink Check)

References
  • IEC 61508-3, Table A.3 (3) 'Language subset’

  • ISO 26262-6, Table 1 (1b) 'Use of language subsets'

  • EN 50128, Table A.4 (11) 'Language Subset'

  • MISRA C:2012

Last ChangedR2019a