Share via


PREfast Warning 314 (Windows CE 5.0)

Send Feedback

314 - Incorrect order of operations.
Additional Information: Bitwise-or has higher precedence than the conditional-expression operator.
Recommended Fix: Add parentheses to clarify intent.

This message indicates that an expression containing a bitwise-OR operator (|) against a nonzero constant was detected in the tested expression of a conditional-expression operation (?:).

The tested expression is constant and always true.

The conditional-expression operator has lower precedence than bitwise operations. If the expression to be tested should not contain the bitwise-OR operator, add parentheses around the conditional-expression.

Example

Defective Source

return 7 | i ? true : false;

Corrected Source

return 7 | (i ? true : false);

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.