From nobody Wed Feb 5 12:51:16 2025 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1737019911; cv=none; d=zohomail.com; s=zohoarc; b=G+RtNzUFk8QwdXKtkFST9CWBZrOE1RKhlx/riFWXvsggnwRlj18vJuJ22cKhxDHeyZyHEUqE9E4SAxHUAbWlXYSO1mrzI0fXbTj6IV81S+Ui57yzWlqqkJgGywB+YVoqIYfBgcV0iokP7WK2mjmO5bN1gVnY2h5h8xhVKTUK9CA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737019911; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p8vjX96/YYSaxoGi8LigI7oSRS+6hB7ciGWTRkM/Bgk=; b=eILdCDEHrChKHS87nrTm+sDANuTun9dByL9NKrzauxZ6oHwxZnKcFK52P4Ztzld9ZSORmlXcVTullA3KXacLfdsRNYouqkcGrhH0cTbLlJ/V9iM1ADM9WqzwuTap1UAVq3N7WO/1kyzlWFoypYDF2UXusXcUwpqPOxvJ8IT1ops= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1737019911556618.1352928691995; Thu, 16 Jan 2025 01:31:51 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.873369.1284333 (Exim 4.92) (envelope-from ) id 1tYMDZ-000561-Rh; Thu, 16 Jan 2025 09:31:13 +0000 Received: by outflank-mailman (output) from mailman id 873369.1284333; Thu, 16 Jan 2025 09:31:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tYMDZ-00055u-OW; Thu, 16 Jan 2025 09:31:13 +0000 Received: by outflank-mailman (input) for mailman id 873369; Thu, 16 Jan 2025 09:31: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 1tYMDX-00055l-P7 for xen-devel@lists.xenproject.org; Thu, 16 Jan 2025 09:31:12 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9dffa93a-d3ec-11ef-99a4-01e77a169b0f; Thu, 16 Jan 2025 10:31:09 +0100 (CET) Received: from nico.bugseng.com (unknown [46.228.253.214]) by support.bugseng.com (Postfix) with ESMTPSA id B9FED4EED422; Thu, 16 Jan 2025 10:31:06 +0100 (CET) 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: 9dffa93a-d3ec-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1737019868; bh=VPfiKdifsI4B8yVlKwmfWHnWIVmO3aBtXYXj03GolT8=; h=From:To:Cc:Subject:Date:From; b=OXKw1ZcIH4J1+S86++YLiHdQf/RMTz5KA2m5sFoJ7eql6MNnvuZCoBUQbhi3O9+Ok KJwIQhLR3YUR0pwrOwJgX4L7TrQrdv4MkgJBZKb1Y3NjxRKi9J7hBVrDAiTQPDjWZG eDgR585h1EP4qcftCworH1BoMn4AbMa4ZYe3C+r40UhE8fBuVjAVtzsXHV9XHdWjWD sP2M+Mg6R/pHN5Ez7zZ9h7SHvJratCvkxkKv1ESoVG+LPAPnboNhtDXhpxzauJb2TQ 1+q2yy3RBqKcD2I6jLHpRUsaKj1pbGZaD/uqhbGHpA9YleSkWceMtt97oakTs0xaWj tpGbIwxLCf2Tw== From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , Andrew Cooper , Anthony PERARD , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [XEN PATCH] docs/misra: Document ECLAIR extension to Rule 20.7 Date: Thu, 16 Jan 2025 10:31:01 +0100 Message-ID: <77354513a986a14c37ec2dfc45cf3534b08b5e85.1736972547.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1737019913864019000 Content-Type: text/plain; charset="utf-8" MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Document the behaviour of ECLAIR with respect to the CPP extension that allows variable macro arguments to be named. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- docs/misra/rules.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index e7763795b826..13890f6d8852 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -671,7 +671,14 @@ maintainers if you want to suggest a change. shall be enclosed in parentheses - Extra parentheses are not required when macro parameters are used as function arguments, as macro arguments, array indices, lhs in - assignments or as initializers in initalizer lists. + assignments or as initializers in initalizer lists. In addition, + the use of a named variable argument in a macro that would constitu= te + a violation of the rule is allowed by ECLAIR as an extension of the + MISRA, since it may not always be possible to parenthesize such + argument and the feature is non-standard:: + + #define M(args...) args + #if M(1) + 0=20 =20 * - `Rule 20.9 `_ - Required --=20 2.43.0