/* >>>------------------------------------------------------------ * * File: rule_12.11.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 12.11 (Advisory): * Evaluation of constant unsigned integer expressions should not * lead to wrap-around. * * Implemented by message: * 2910 Constant: Wraparound in unsigned arithmetic operation. * * <<<------------------------------------------------------------ */ /* PRQA S 2982,3198,3205 ++ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1211( void ) { u32a = 0x1U - 0x2U; /* MISRA Violation */ u32a = 0xFFFFFFFFU + 0x2U; /* MISRA Violation */ u32a = 0xFFFFU + 0x2U; /* MISRA Violation */ u32a = 0xFFU + 0x2U; u32a = 0x0FFFFFFFU * 32U; /* MISRA Violation */ u32a = 0x0FFFU * 32U; /* MISRA Violation */ u32a = 0x0FU * 32U; return 0; }