다음을 통해 공유


PREfast Warning 236 (Windows CE 5.0)

Send Feedback

236 - (<expression> || <non-zero constant>) is always TRUE.
Question: Was the bitwise-and operator intended?This warning indicates that a constant value greater than one was detected on the right side of a logical-OR operation that occurs in a test context. The resulting expression always evaluates to TRUE.

A constant value greater than one suggests that | or & might have been intended. If not, consider using a constant that evaluates to 1.

Example

Defective Source

if (x || 3) {;}

Corrected Source

if (x & 3) {;}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.