MISRA.FOR.COND.EQ++ or -- operations are not used to change loop counter, but condition tests loop counter for equality. MISRA-C++ Rule 6-5-2 (required): If ''loop-counter'' is not modified by -- or ++, then, within ''condition'', the ''loop-counter'' shall only be used as an operand to <=, <, > or >=.RationaleWhen the loop-counter is modified using an operator other than '--' or '++', then '==' and '!=' shall not be used, as loop termination may not occur, which may be inconsistent with developer expectations. Examplefor ( i = 1; i != 10; i += 2 ) // Non-compliant for ( i = 1; i <= 10; i += 2 ) // Compliant for ( i = 1; i != 10; ++i ) // Compliant |