MISRA.FOR.COND.CHANGEFor loop condition modifies loop counter. MISRA-C++ Rule 6-5-3 (required): The loop-counter shall not be modified within condition or statement.This rule is also covered by MISRA.FOR.STMT.CHANGE. RationaleModification of the loop-counter other than in expression leads to a badly-formed for loop. Examplebool modify ( int32_t * pX ) { *pX++; return ( *pX < 10 ); } for ( x = 0; modify ( &x ); ) // Non-compliant { } for ( x = 0; x < 10; ) { x = x * 2; // Non-compliant } |