/* >>>------------------------------------------------------------ * * File: rule_14.8.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 14.8 (Required): * The statement forming the body of a switch, while, do ... while * or for statement shall be a compound statement. * * Implemented by messages: * 2212 Body of control statement is not enclosed within braces. * * 2214 Body of control statement is on the same line and is not * enclosed within braces. * * <<<------------------------------------------------------------ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1408( void ) { S16 n; for ( n = 0; n < 5; n++ ) ++s16a; /* MISRA Violation */ for ( n = 0; n < 5; n++ ) ++s16a; /* MISRA Violation */ while ( s16b < 5 ) s16b++; /* MISRA Violation */ do s16c++; while ( s16c < 9 ); /* MISRA Violation */ return s16a; }