Compartilhar via


PREfast Warning 295 (Windows CE 5.0)

Send Feedback

295 - Ill-defined for-loop.
Additional Information: Unsigned values are always >= 0.

This warning indicates that PREfast has detected a for-loop that might not function as intended.

The for-loop tests an unsigned value against zero (0) with >=.

The result is always TRUE so the loop is infinite.

Example

Defective Source

unsigned char i;

for (i = 100; i >= 0; i--) { ; }

Corrected Source

unsigned char i;

for (i = 100; i > 0; i--) { ; }

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.