Developer Guide and Reference

Contents

fprotect-parens, Qprotect-parens

Determines whether the optimizer honors parentheses when floating-point expressions are evaluated.

Syntax

Linux and macOS:
-fprotect-parens
-fno-protect-parens
Windows:
/Qprotect-parens
/Qprotect-parens-
Arguments
None
Default
-fno-protect-parens
or
/Qprotect-parens-
Parentheses are ignored when determining the order of expression evaluation.
Description
This option determines whether the optimizer honors parentheses when determining the order of floating-point expression evaluation.
When option
-fprotect-parens
(Linux* and
macOS*
) or
/Qprotect-parens
(Windows*) is specified, the optimizer will maintain the order of evaluation imposed by parentheses in the code.
When option
-fno-protect-parens
(Linux* and
macOS*
) or
/Qprotect-parens-
(Windows*) is specified, the optimizer may reorder floating-point expressions without regard for parentheses if it produces faster executing code.
Alternate Options
None
Consider the following expression:
A+(B+C)
By default, the parentheses are ignored and the compiler is free to re-order the floating-point operations based on the optimization level, the setting of option