Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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