|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH 03/10] automation/eclair_analysis: deviate macro count_args_ for MISRA Rule 20.7
On 2024-04-25 02:28, Stefano Stabellini wrote: On Tue, 23 Apr 2024, Nicola Vetrini wrote:The count_args_ macro violates Rule 20.7, but it can't be made compliant with Rule 20.7 without breaking its functionality. Since it's very unlikely for this macro to be misused, it is deviated.That is OK but can't we use the SAF- framework to do it, given that it is just one macro? If not, this is also OK. It would be more fragile, for no substantial gain No functional change. Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ docs/misra/deviations.rst | 6 ++++++ 2 files changed, 12 insertions(+)diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.eclindex d21f112a9b94..c17e2f5a0886 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -445,6 +445,12 @@ not to parenthesize their arguments."-config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^alternative_(v)?call[0-9]$))))"}-doc_end+-doc_begin="The argument 'x' of the count_args_ macro can't be parenthesized as +the rule would require, without breaking the functionality of the macro. The uses +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="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 -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |