Compartilhar via


PREfast Warning 293 (Windows CE 5.0)

Send Feedback

293 - Ill-defined for-loop.
Additional Information: Counts down from "minimum".

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

A signed index variable in conjunction with a negative increment causes the loop to count negative until integer overflow occurs, which terminates the loop.

The consequence of this error is that the loop control variable goes negative.

Example

Defective Source

signed char i;

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

Corrected Source

signed char i;

for (i = 0; i < 100; i++) { ; }

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.