diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 9051f41602..ed80ac7958 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -581,6 +581,12 @@ of this macro do not lead to developer confusion, and can thus be deviated." -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"} -doc_end +-doc_begin="The argument \"fn\" in macros {COMPILE,RUNTIME}_CHECK is not parenthesized +on purpose, to be able to test function-like macros. Given the specialized and limited +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="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 b66c271c4e..74bb815bf0 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -534,6 +534,14 @@ Deviations related to MISRA C:2012 Rules: refactoring it to add parentheses breaks its functionality. - Tagged as `safe` for ECLAIR. + * - R20.7 + - The macros `{COMPILE,RUNTIME}_CHECK` defined in + `xen/include/xen/self-tests.h` are allowed not to parenthesize the "fn" + argument, to allow function-like macros to be tested as well as + functions. Given the specialized use of these macros and their limited + usage scope, omitting parentheses is deemed unlikely to cause issues. + - Tagged as `deliberate` 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