/* >>>------------------------------------------------------------ * * File: rule_12.13.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 12.13 (Advisory): * The increment (++) and decrement (--) operators should not be * mixed with other operators in an expression. * * Implemented by message: * 3440 Using the value resulting from a ++ or -- operation. * * <<<------------------------------------------------------------ */ /* PRQA S 2982-2984,3198,3199 ++ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1213( void ) { S16 x = 0; S16 r; ++x; x++; --x; x--; r = ++x; /* MISRA Violation */ r = x++; /* MISRA Violation */ r = --x; /* MISRA Violation */ r = x--; /* MISRA Violation */ return r; }