/* >>>------------------------------------------------------------ * * File: rule_14.2.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 14.2 (Required): * All non-null statements shall either (i) have at least one side * effect however executed, or (ii) cause control flow to change. * * Implemented by messages: * 3110 The left-hand operand of this ',' has no side effects. * * 3112 This statement has no side-effect - it can be removed. * * 3425 One branch of this conditional operation is a redundant * expression. * * 3426 Right hand side of comma expression has no side effect * and its value is not used. * * 3427 Right hand side of logical operator has no side effect * and its value is not used. * * <<<------------------------------------------------------------ */ /* PRQA S 2982,2984,3199 ++ */ #include "misra.h" #include "m2cmex.h" static S16 test_1402a( S16 n ); extern S16 test_1402( void ) { S16 x = 2; S16 n = 0; n = n; x + 1, --x; /* MISRA Violation */ x = 0, x + 1; /* MISRA Violation */ n; /* MISRA Violation */ ( s16a > 0 ) ? test_1402a(n) : n; /* MISRA Violation */ (test_1402a( n ) != 0) && (s16b > s16c); /* MISRA Violation */ return 1; } static S16 test_1402a( S16 n ) { return n + 1; }