/* >>>------------------------------------------------------------ * * File: rule_15.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 15.1 (Required): * A switch label shall only be used when the most * closely-enclosing compound statement is the body of a switch * statement. * * Implemented by message: * 2019 'Switch' label is located within a nested code block. * * <<<------------------------------------------------------------ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1501( void ) { switch ( s16a ) { case 0: if ( s16b == 1 ) { case 1: /* MISRA Violation */ break; } while ( s16b < 10 ) { ++s16b; case 2: break; } default: break; } return 1; }