This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Configuration Settings

hisl_0060: Configuration parameters that improve MISRA C:2012 compliance

ID: Titlehisl_0060: Configuration parameters that improve MISRA C:2012 compliance
DescriptionTo improve MISRA C:2012 compliance of the generated code,

Set the following model configuration parameters as specified:

Configuration ParameterValue
Math and Data Types
Use division for fixed-point net slope computation On or Use division for reciprocals of integers only.
Diagnostics
Inf or NaN block outputwarning or error
Model Verification block enablingDisable All
Undirected event broadcastserror
Wrap on overflowwarning or error
Hardware Implementation
Production hardware signed integer division rounds toZero or Floor
Shift right on a signed integer as arithmetic shiftCleared (off)
Simulation Target
Compile-time recursion limit for MATLAB functions0
Dynamic memory allocation in MATLAB functions Cleared (off)
Enable run-time recursion for MATLAB functionsCleared (off)
Code Generation

Bitfield declarator type specifier

This parameter is only available for ERT-based targets.

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

Casting ModesStandards Compliant
Code replacement libraryNone or AUTOSAR 4.0
External modeCleared (off)
Generate shared constantsCleared (off)
Include Comments

Selected (on)

MAT-file loggingCleared (off)
MATLAB user comments

Selected (on)

Maximum identifier lengthThis should be set to the implementation dependent limit. The default is 31.
Parentheses levelMaximum (Specify precedence with parentheses)
Preserve static keyword in function declarations

Selected (on)

Select only when configuration parameter File packaging format is set to Compact or CompactWithDataFile

Replace multiplications by powers of two with signed bitwise shiftsCleared (off)
Shared code placementShared location
Standard math library C89/C90 (ANSI) or C99 (ISO) depending on toolchain

Support complex numbers

This parameter is only available for ERT-based targets.

Cleared (off) if you do not need complex number support

Support continuous time

This parameter is only available for ERT-based targets.

Cleared (off)
Support non-finite numbersCleared (off)

Support non-inlined S-functions

This parameter is only available for ERT-based targets.

Cleared (off)
System-generated identifiersShortened
System target fileERT-based target
Use dynamic memory allocation for model initialization

Cleared (off)

Select only when configuration parameter Code Interface Packaging is set to Reusable Function.

RationaleImprove MISRA C:2012 compliance of the generated code.
Model Advisor Checks
  • By Task > Modeling Standards for DO-178C/DO-331 > High-Integrity Systems > Code > Check configuration parameters for MISRA C:2012

  • By Task > Modeling Standards for IEC 61508 > High-Integrity Systems > Code > Check configuration parameters for MISRA C:2012

  • By Task > Modeling Standards for IEC 62304 > High-Integrity Systems > Code > Check configuration parameters for MISRA C:2012

  • By Task > Modeling Standards for EN 50128 > High-Integrity Systems > Code > Check configuration parameters for MISRA C:2012

  • By Task > Modeling Standards for ISO 26262 > High-Integrity Systems > Code > Check configuration parameters for MISRA C:2012

  • By Task > Modeling Guidelines for MISRA C:2012 > Check configuration parameters for MISRA C:2012

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

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

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