/* >>>------------------------------------------------------------ * * File: rule_15.4.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 15.4 (Required): * A switch expression shall not represent a value that is * effectively Boolean. * * Implemented by message: * 735 Using relational or logical operators in a 'switch' * expression is usually a programming error. * * <<<------------------------------------------------------------ */ /* PRQA S 2984 ++ */ #include #include "misra.h" #include "m2cmex.h" extern S16 test_1504( void ) { S16 x = 0; switch ( s16a ) { case 2: x = 1; break; default: ++x; break; } /* MISRA Violation */ switch ( u16b == 5u) /* MISRA Violation */ { case true: x = 1; break; default: ++x; break; } return x; }