/* >>>------------------------------------------------------------ * * File: rule_13.5.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 13.5 (Required): * The three expressions of a for statement shall be concerned * only with loop control. * * Implemented by messages: * 2462 The variable initialized in the first expression of this * 'for' statement is not the variable identified as the * 'loop control variable' (%s). * * 2463 The variable incremented in the third expression of this * 'for' statement is not the variable identified as the * 'loop control variable' (%s). * * <<<------------------------------------------------------------ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1305( void ) { S16 n; n = 0; for ( s16a++; n < 10; n++ ) /* MISRA Violation */ { s16b = s16b + s16a; } for ( s16a = 0; ++s16a < 10; ++s16b ) /* MISRA Violation - also Rule 12.13 */ { ++s16b; } return s16b; }