@@ -363,63 +363,6 @@ unexpected result when the structure is given as argument to a sizeof() operator
363363- config= MC3A2.R18.7 ,reports+= {deliberate, "any()"}
364364- doc_end
365365
366- #
367- # Series 20 .
368- #
369-
370- - doc_begin= "Code violating Rule 20.7 is safe when macro parameters are used: (1 )
371- as function arguments; (2 ) as macro arguments; (3 ) as array indices; (4 ) as lhs
372- in assignments; (5 ) as initializers, possibly designated, in initializer lists;
373- (6 ) as the constant expression in a switch clause label."
374- - config= MC3A2.R20.7 ,expansion_context=
375- {safe, "context(__call_expr_arg_contexts)"},
376- {safe, "left_right(^[(,\\[]$,^[),\\]]$)"},
377- {safe, "context(skip(parent(__expr_non_syntactic_contexts), is(subscript)&&parent(node(array_subscript_expr))))"},
378- {safe, "context(skip(parent(__expr_non_syntactic_contexts), is(lhs)&&parent(stmt(operator(assign)))))"},
379- {safe, "context(skip(parent(__expr_non_syntactic_contexts), is(init)&&parent(node(init_list_expr|| designated_init_expr))))"},
380- {safe, "context(skip(parent(__expr_non_syntactic_contexts), is(lower|| upper)&&parent(node(case_stmt))))"}
381- - doc_end
382-
383- - doc_begin= "Violations involving the __config_enabled macros cannot be fixed without
384- breaking the macro 's logic; furthermore, the macro is only ever used in the context
385- of the IS_ENABLED or STATIC_IF/ STATIC_IF_NOT macros, so it always receives a literal
386- 0 or 1 as input, posing no risk to safety."
387- - config= MC3A2.R20.7 ,reports+= {safe, "any_area(any_loc(any_exp(macro (^___config_enabled$))))"}
388- - doc_end
389-
390- - doc_begin= "To avoid compromising readability, the macros alternative_(v)?call[0 - 9 ] are allowed
391- not to parenthesize their arguments."
392- - config= MC3A2.R20.7 ,reports+= {safe, "any_area(any_loc(any_exp(macro (^alternative_(v)?call[0 - 9 ]$))))"}
393- - doc_end
394-
395- - doc_begin= "The argument 'x' of the count_args_ macro can't be parenthesized as
396- the rule would require, without breaking the functionality of the macro . The uses
397- of this macro do not lead to developer confusion, and can thus be deviated."
398- - config= MC3A2.R20.7 ,reports+= {safe, "any_area(any_loc(any_exp(macro (^count_args_$))))"}
399- - doc_end
400-
401- - doc_begin= "The argument \"fn\" in macros {COMPILE,RUNTIME}_CHECK is not parenthesized
402- on purpose, to be able to test function - like macros. Given the specialized and limited
403- use of this macro , it is deemed ok to deviate them."
404- - config= MC3A2.R20.7 ,reports+= {deliberate, "any_area(any_loc(any_exp(macro (^(COMPILE_CHECK| RUNTIME_CHECK)$))))"}
405- - doc_end
406-
407- - doc_begin= "Problems related to operator precedence can not occur if the expansion of the macro argument is surrounded by tokens '{' , '}' and ';' ."
408- - config= MC3A2.R20.7 ,expansion_context+= {safe, "left_right(^[\\{;]$,^[;\\}]$)"}
409- - doc_end
410-
411- - doc_begin= "Uses of variadic macros that have one of their arguments defined as
412- a macro and used within the body for both ordinary parameter expansion and as an
413- operand to the # or ## operators have a behavior that is well- understood and
414- deliberate."
415- - config= MC3A2.R20.12 ,macros+= {deliberate, "variadic()"}
416- - doc_end
417-
418- - doc_begin= "Uses of a macro parameter for ordinary expansion and as an operand
419- to the # or ## operators within the following macros are deliberate, to provide
420- useful diagnostic messages to the user."
421- - config= MC3A2.R20.12 ,macros+= {deliberate, "name(__ASSERT|| __ASSERT_NO_MSG|| BUILD_ASSERT)"}
422- - doc_end
423366
424367#
425368# Series 21 .
0 commit comments