/* >>>------------------------------------------------------------ * * File: rule_12.4.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 12.4 (Required): * The right hand operand of a logical && or || operator shall not * contain side effects. * * Implemented by message: * 3415 Right hand operand of '&&' or '||' is an expression with * possible side effects. * * <<<------------------------------------------------------------ */ #include "misra.h" #include "m2cmex.h" static S16 test_1204a( S16 x ); extern S16 test_1204( void ) { if ( ( s16a > 1 ) && ( s16b++ < 0 ) ) /* MISRA Violation - Also Rule 12.13 */ { ++s16r; } if ( ( s16b > 0 ) || ( test_1204a( s16a ) != 0 ) ) /* OK */ { ++s16r; } return 1; } static S16 test_1204a( S16 x ) { return x + x; }