Main Content

Preserve static keyword in function declarations

Include static keyword in function declarations

Model Configuration Pane: Code Generation / Code Style

Description

Specify whether to include the static keyword in function declarations in the generated code.

Dependencies

  • This parameter requires Embedded Coder® license when you generate code.

  • This parameter appears only for ERT-based targets.

  • This parameter is enabled when you select Compact/Compact(with separate data file) file packaging.

Settings

on (default) | off

Default: on

On

Include the static keyword in function declarations in the generated code. You can link different executables generated from different models that refer to locally scoped subsystem and utility functions with the same name. This parameter also impacts these functions:

  • Stateflow® graphical function

  • Variant subsystem

  • MATLAB® subfunction

  • Privately scoped Simulink® function

When you select this parameter, the generated code is compliant with MISRA C:2012 Rule 8.10.

Off

Remove the static keyword in function declarations in the generated code.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn (execution, ROM)
Safety precautionNo impact

Programmatic Use

Parameter: PreserveStaticInFcnDecls
Type: character vector
Value: 'on' | 'off'
Default: 'on'

Version History

Introduced in R2017b