다음을 통해 공유


PREfast Warning 287 (Windows CE 5.0)

Send Feedback

287 - Redundant code.
Additional Information: The left and right sub-expressions are identical.

This warning indicates that redundant element was detected in an expression.

It is difficult to judge the severity of this problem without examining the code. A duplicate test on its own is benign, but if a second test was omitted, the consequences can be severe.

The code should be inspected to ensure that a test was not omitted. This warning is highly accurate.

Example

Defective Source

if ((x == 1) && (x == 1)) {;}
if ((x != 1) || (x != 1)) {;}

Corrected Source

// Remove the redundant subexpression: 

if (x == 1) {;}
if (x != 1) {;}


// Or test the missing variable: 

if ((x == 1) && (y == 1)) {;}
if ((x != 1) || (y != 1)) {;}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.