Main Content

Comment style

Description

Specify comment style in the generated C/C++ code.

Category: Code Generation > Comments

Settings

Default: Auto

Auto

For C code, generate single- or multiple-line comments delimited by /* and */. For C++ code, generate single-line comments preceded by //.

Multi-line

Generate single- or multiple-line comments delimited by /* and */.

Example of code generated by using the multiline comment style is:

/* Sum: '<Root>/Sum' incorporates:
 *  Constant: '<Root>/INC'
 *  UnitDelay: '<Root>/X'
 */
rtDW.X_g++;
Single-line

Generate single-line comments preceded by //.

Example of code generated by using the single-line comment style is:

// Sum: '<Root>/Sum' incorporates:
//   Constant: '<Root>/INC'
//   UnitDelay: '<Root>/X'

rtDW.X_g++;

Note

For C code generation, select Single-line only if your compiler supports it.

Dependencies

This parameter:

  • Appears only for ERT-based targets.

  • Requires Embedded Coder® when generating code.

Command-Line Information

Parameter: CommentStyle
Type: character vector
Value: Auto | Multi-line | Single-line
Default: Auto

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Related Topics