Specify parenthesization style for generated code.
Category: Code Generation > Code Style
Default: Nominal
(Optimize for readability)
Inserts parentheses only where required by ANSI®[1] C or C++, or to override default precedence. For example:
Out = In2 - In1 > 1.0 && In2 > 2.0;
If you generate C/C++ code using the minimum level, for certain settings in some compilers, you can receive compiler warnings. To eliminate these warnings, try the nominal level.
Inserts parentheses in a way that compromises between readability and visual complexity. For example:
Out = ((In2 - In1 > 1.0) && (In2 > 2.0));
Includes parentheses to specify meaning without relying on operator precedence. Code generated with this setting conforms to MISRA®[2] requirements. For example:
Out = (((In2 - In1) > 1.0) && (In2 > 2.0));
Parameter: ParenthesesLevel |
Type: character vector |
Value: 'Minimum' | 'Nominal' | 'Maximum' |
Default: 'Nominal' |
Application | Setting |
---|---|
Debugging | Nominal (Optimized for readability) |
Traceability | Nominal (Optimized for readability) |
Efficiency | Minimum (Rely on C/C++ operators for precedence) |
Safety precaution | No recommendation |
[1] ANSI is a registered trademark of the American National Standards Institute, Inc.
[2] MISRA is a registered trademarks of MIRA Ltd, held on behalf of the MISRA Consortium.