From nobody Mon Feb 9 23:19:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1713885208302444.7557208549608; Tue, 23 Apr 2024 08:13:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.710791.1110268 (Exim 4.92) (envelope-from ) id 1rzHpa-0005my-Q3; Tue, 23 Apr 2024 15:13:14 +0000 Received: by outflank-mailman (output) from mailman id 710791.1110268; Tue, 23 Apr 2024 15:13:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzHpa-0005mq-NR; Tue, 23 Apr 2024 15:13:14 +0000 Received: by outflank-mailman (input) for mailman id 710791; Tue, 23 Apr 2024 15:13:12 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzHpY-0003wh-IB for xen-devel@lists.xenproject.org; Tue, 23 Apr 2024 15:13:12 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ff489b4c-0183-11ef-b4bb-af5377834399; Tue, 23 Apr 2024 17:13:10 +0200 (CEST) Received: from nico.bugseng.com.homenet.telecomitalia.it (host-79-60-221-62.business.telecomitalia.it [79.60.221.62]) by support.bugseng.com (Postfix) with ESMTPSA id 9A8144EE073E; Tue, 23 Apr 2024 17:13:07 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ff489b4c-0183-11ef-b4bb-af5377834399 From: Nicola Vetrini To: xen-devel@lists.xenproject.org, nicola.vetrini@bugseng.com Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, bertrand.marquis@arm.com, julien@xen.org, Simone Ballarin , Doug Goldstein , Andrew Cooper , George Dunlap , Jan Beulich Subject: [XEN PATCH 03/10] automation/eclair_analysis: deviate macro count_args_ for MISRA Rule 20.7 Date: Tue, 23 Apr 2024 17:12:45 +0200 Message-Id: <7de407c218f0911e28b7c3f609a55636165166a8.1713885065.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1713885210336100008 Content-Type: text/plain; charset="utf-8" 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. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- 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.ecl index 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=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^a= lternative_(v)?call[0-9]$))))"} -doc_end =20 +-doc_begin=3D"The argument 'x' of the count_args_ macro can't be parenthes= ized as +the rule would require, without breaking the functionality of the macro. T= he uses +of this macro do not lead to developer confusion, and can thus be deviated= ." +-config=3DMC3R1.R20.7,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^c= ount_args_$))))"} +-doc_end + -doc_begin=3D"Uses of variadic macros that have one of their arguments def= ined 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 a= nd diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index ed0c1e8ed0bf..e228ae2e715f 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -371,6 +371,12 @@ Deviations related to MISRA C:2012 Rules: sanity checks in place. - Tagged as `safe` for ECLAIR. =20 + * - R20.7 + - The macro `count_args_` is not compliant with the rule, but is not = likely + to incur in the risk of being misused or lead to developer confusio= n, and + refactoring it to add parentheses breaks its functionality. + - Tagged as `safe` for ECLAIR. + * - R20.12 - Variadic macros that use token pasting often employ the gcc extensi= on `ext_paste_comma`, as detailed in `C-language-toolchain.rst`, which= is --=20 2.34.1