From patchwork Wed Apr 24 12:23:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13641778 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C69FC4345F for ; Wed, 24 Apr 2024 12:24:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.711390.1111300 (Exim 4.92) (envelope-from ) id 1rzbfE-0002rt-K1; Wed, 24 Apr 2024 12:23:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 711390.1111300; Wed, 24 Apr 2024 12:23:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzbfE-0002rm-HU; Wed, 24 Apr 2024 12:23:52 +0000 Received: by outflank-mailman (input) for mailman id 711390; Wed, 24 Apr 2024 12:23:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzbfC-0002oV-Qw for xen-devel@lists.xenproject.org; Wed, 24 Apr 2024 12:23:50 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 81398c7e-0235-11ef-909a-e314d9c70b13; Wed, 24 Apr 2024 14:23:49 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-60-221-62.business.telecomitalia.it [79.60.221.62]) by support.bugseng.com (Postfix) with ESMTPSA id 84E704EE0739; Wed, 24 Apr 2024 14:23:48 +0200 (CEST) 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: 81398c7e-0235-11ef-909a-e314d9c70b13 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Simone Ballarin , Doug Goldstein , Stefano Stabellini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH] automation/eclair: add deviation of MISRA C:2012 Rule 14.4 Date: Wed, 24 Apr 2024 14:23:41 +0200 Message-Id: <899a456dc9fcd9ceb55efdfb95e71d0abd997700.1713961291.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Update ECLAIR configuration to take into account the deviations agreed during MISRA meetings. Amend an existing entry of Rule 14.4 in deviations.rst: it is not a project-wide deviation. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++ docs/misra/deviations.rst | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index d21f112a9b..f1a29389fd 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -349,6 +349,10 @@ therefore have the same behavior of a boolean" -config=MC3R1.R14.4,etypes+={deliberate, "stmt(child(cond,child(expr,ref(^?::is_dying$))))","src_type(enum)"} -doc_end +-doc_begin="A controlling expression of 'if' and iteration statements having integer, character or pointer type has a semantics that is well-known to all Xen developers." +-config=MC3R1.R14.4,etypes+={deliberate, "any()", "src_type(integer||character)||src_expr(type(desugar(pointer(any()))))"} +-doc_end + # # Series 16. # diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst index ed0c1e8ed0..a9d9cca04d 100644 --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -294,7 +294,13 @@ Deviations related to MISRA C:2012 Rules: - The XEN team relies on the fact that the enum is_dying has the constant with assigned value 0 act as false and the other ones as true, therefore have the same behavior of a boolean. - - Project-wide deviation; tagged as `deliberate` for ECLAIR. + - Tagged as `deliberate` for ECLAIR. + + * - R14.4 + - A controlling expression of 'if' and iteration statements having + integer, character or pointer type has a semantics that is well-known to + all Xen developers. + - Tagged as `deliberate` for ECLAIR. * - R16.2 - Complying with the Rule would entail a lot of code duplication in the