/* >>>------------------------------------------------------------ * * File: rule_12.8.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 12.8 (Required): * The right hand operand of a shift operator shall lie between * zero and one less than the width in bits of the underlying type of * the left hand operand. * * Implemented by messages: * 499 Right operand of shift operator is greater than or equal * to the width of the essential type of the left operand. * * 2790 Constant: Right hand operand of shift operator is * negative or too large. * * <<<------------------------------------------------------------ */ /* PRQA S 2982,2984 ++ */ #include "misra.h" #include "m2cmex.h" #define SHIFT16 16 #define SHIFT15 15 #define SHIFT8 8 #define SHIFT7 7 #define SHIFT1 1 #define SHIFTM1 (-1) extern S16 test_1208( void ) { u16r = u16a >> SHIFT1; u16r = u16a >> SHIFT15; u16r = u16a >> SHIFT16; /* MISRA Violation */ u16r = u16a >> SHIFTM1; /* MISRA Violation */ u8r = u8a >> SHIFT8; /* MISRA Violation */ u8r = u8a >> SHIFT7; return 1; }