/* >>>------------------------------------------------------------ * * File: rule_19.10.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 19.10 (Required): * In the definition of a function-like macro each instance of a * parameter shall be enclosed in parentheses unless it is used as * the operand of # or ##. * * Implemented by message: * 3410 Macro parameter not enclosed in (). * * <<<------------------------------------------------------------ */ /* PRQA S 3429 ++ */ #include "misra.h" #include "m2cmex.h" #define MAXCONST 5 /* OK */ #define MAX1( A,B ) ((( A ) > ( B )) ? ( A ) : ( B )) /* OK */ #define MAX2( A,B ) ((( A > B ) ? A : B )) /* MISRA Violation */ extern S16 test_1910( void ) { S16 i; S16 j; S16 k = MAXCONST; i = MAX1( s16a, s16b ); j = MAX2( s16a, s16b ); return i + j + k; }