/* >>>------------------------------------------------------------ * * File: rule_13.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 13.1 (Required): * Assignment operators shall not be used in expressions that * yield a Boolean value. * * Implemented by message: * 3326 The result of an assignment is being used in a logical * operation. * * <<<------------------------------------------------------------ */ #include "misra.h" #include "m2cmex.h" extern S16 test_1301( void ) { S16 x; S16 r = 0; if ( x = s16a ) /* MISRA Violation - also Rule 13.2 */ { r = 1; } if ( ( x = s16b ) != 0 ) /* MISRA Violation */ { r = 1; } while ( ( x += 2 ) < 0 ) /* MISRA Violation */ { ++x; } return r; }