#include void example ( void ) { int16_t x; /* ----------------- Example code from MISRA C:2012 begin ----------------- */ switch ( x ) { default: /* Compliant */ case 0: ++x; break; case 1: case 2: break; } switch ( x ) { case 0: ++x; break; default: /* Non-compliant */ x = 0; break; case 1: case 2: break; } switch ( x ) { case 0: ++x; break; case 1: case 2: break; default: /* Compliant */ x = 0; break; } /* ------------------ Example code from MISRA C:2012 end ------------------ */ }