diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 9c3ebc9cc7..6679caf3da 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -598,6 +598,10 @@ use of this macro, it is deemed ok to deviate them." -config=MC3R1.R20.7,reports+={deliberate, "any_area(any_loc(any_exp(macro(^(COMPILE_CHECK|RUNTIME_CHECK)$))))"} -doc_end +-doc_begin="Problems related to operator precedence can not occur if the expansion of the macro argument is surrounded by tokens '{', '}' and ';'." +-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"} +-doc_end + -doc_begin="Uses of variadic macros that have one of their arguments defined as a macro and used within the body for both ordinary parameter expansion and as an operand to the # or ## operators have a behavior that is well-understood and diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index 247e69e7f1..15a993d050 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -552,6 +552,11 @@ Deviations related to MISRA C:2012 Rules: usage scope, omitting parentheses is deemed unlikely to cause issues. - Tagged as `deliberate` for ECLAIR. + * - R20.7 + - Problems related to operator precedence can not occur if the expansion + of the macro argument is surrounded by tokens '{', '}' and ';'. + - Tagged as `safe` for ECLAIR. + * - R20.12 - Variadic macros that use token pasting often employ the gcc extension `ext_paste_comma`, as detailed in `C-language-toolchain.rst`, which is