#include typedef _Bool bool_t; void example ( void ) { bool_t errorflag; /* ----------------- Example code from MISRA C:2012 begin ----------------- */ int16_t x; switch ( x ) /* Non-compliant */ { case 0: ++x; break; case 1: case 2: break; } switch ( x ) /* Compliant */ { case 0: ++x; break; case 1: case 2: break; default: errorflag = 1; break; } enum Colours { RED, GREEN, BLUE } colour, next; switch ( colour ) /* Non-compliant */ { case RED: next = GREEN; break; case GREEN: next = BLUE; break; case BLUE: next = RED; break; } /* ------------------ Example code from MISRA C:2012 end ------------------ */ }