/* >>>------------------------------------------------------------ * * File: rule_12.10.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 12.10 (Required): * The comma operator shall not be used. * * Implemented by messages: * 3417 The comma operator has been used outside a 'for' * statement. * * 3418 The comma operator has been used in a 'for' statement. * * <<<------------------------------------------------------------ */ /* PRQA S 2984 ++ */ #include "misra.h" #include "m2cmex.h" #define A (-5) #define B 3 extern S16 test_1210( void ) { S16 x; S16 y; S16 i; y = ( x = A, x + B ); /* MISRA Violation */ for ( i = 0, ++y; i < B; ++i ) /* MISRA Violation */ { ++y; } return y; }