Documentation

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,
A

Set the following model configuration parameters as specified:

Pane / Configuration ParameterValue
All Parameters tab 
   Model Verification block enablingDisable All
   Support non-inlined S-functionsCleared (off)
   MAT-file loggingCleared (off)
   Standard math libraryC89/C90 (ANSI)
Code Generation pane 
   System target fileERT-based target
Code Generation > Interface pane 
   Support: non-finite numbersCleared (off)
   Support: continuous timeCleared (off)
   Code replacement libraryNone
Code Generation > Code Style pane 
   Parentheses levelMaximum (Specify precedence with parentheses)
Code Generation > Symbols pane 
   Maximum identifier length31

Note

If you follow this and other modeling guidelines, you increase the likelihood of generating code that complies with the MISRA C:2012 standard.

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

By Product > Embedded Coder > Check configuration parameters for MISRA C:2012 compliance

For check details, see Check configuration parameters for MISRA C:2012.

References
  • MISRA C:2012

Last ChangedR2015b

hisl_0312: Specify target specific configuration parameters to improve MISRA C:2012 compliance

ID: Titlehisl_0312: Specify target specific configuration parameters to improve MISRA C:2012 compliance
DescriptionTo improve MISRA C:2012 compliance of generated code, use a consistent set of model parameters. The parameters include, but are not limited to:
AExplicitly setting model character encoding using the slCharacterEncoding(encoding) function.
BIn the Configuration Parameters dialog box, explicitly selecting a Hardware Implementation > Signed integer division rounds to: parameter.
 
 
CIf complex numbers are not required, deselecting the Code Generation > Interface > Software Environment > complex numbers parameter. 
NotesBase the selection of the integer division method on the target hardware and compiler. When available, in the Configuration Parameters dialog box, specify both of these parameters:
  • Hardware Implementation > Device vendor

  • Hardware Implementation > Device type

 
RationaleImprove MISRA C:2012 compliance of the generated code. 
See Also 
References
  • MISRA C:2012, Dir 1.1

 
Last ChangedR2015b 

hisl_0313: Selection of bitfield data types to improve MISRA C:2012 compliance

ID: Titlehisl_0313: Selection of bitfield data types to improve MISRA C:2012 compliance
DescriptionTo improve MISRA C:2012 compliance of generated code when bitfields are used, in the Configuration Parameters dialog box, set Optimization > Signals and Parameters > Code generation > Bitfield declarator type specifier to uint_T.
RationaleImprove MISRA C:2012 compliance of the generated code.
NotesSet Bitfield declarator type specifier to uint_T if any of the following Optimization parameters are enabled:
  • Optimization > Signals and Parameters > Code generation > Pack Boolean data into bitfields

  • Optimization > Stateflow > Code generation > Use bitsets for storing state configuration

  • Optimization > Stateflow > Code generation > Use bitsets for storing Boolean data

See Also
References
  • MISRA C:2012, Rule 6.1

Last ChangedR2015b

Was this topic helpful?