14-10-2013, 10:16 AM
A loop counter is defined as loop control variable that is, among other conditions,
The examples for rule 6-5-3 state:
But in both cases x is not a loop counter due to condition © being not satisfied (the expression is empty, no modification of x here), and thus the rule's text is not violated.
Should the examples be changed to contain a ++x in the expression?
Quote:© modified in expression
The examples for rule 6-5-3 state:
Code:
for (x = 0; modify(&x); ) // Non-compliant
{
}
for (x = 0; x < 10; )
{
x = x * 2; // Non-compliant
}
Should the examples be changed to contain a ++x in the expression?
<t></t>