다음을 통해 공유


PREfast Warning 313 (Windows CE 5.0)

Send Feedback

313 - Incorrect operator.
Additional Information: Zero-valued flag cannot be tested with bitwise-and.
Recommended Fix: Use an equality test to check for zero-valued flags.

This message indicates that a constant value of 0 was provided as an argument to the bitwise-AND (&) operator in a test context.

The resulting expression is constant and evaluates to false.

This is typically caused by using bitwise-and to test for a flag that has the value 0. To test 0-valued flags, a test for equality must be performed (for example, using == or !=).

Example

Defective Source

#define FLAG    0

if (Flags & FLAG) {
    ;
}

Corrected Source

#define FLAG    0

if (Flags == FLAG) {
    ;
}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.