Xen-Devel Archive mirror
 help / color / mirror / Atom feed
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>
Subject: [XEN PATCH v2] automation/eclair: add deviation of MISRA C:2012 Rule 14.4
Date: Thu,  2 May 2024 15:11:15 +0200	[thread overview]
Message-ID: <ce16233b539f4101d97b3e2962607c87b188c415.1714655082.git.federico.serafini@bugseng.com> (raw)

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.

Tag Rule 14.4 as clean for arm.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
- reordered deviations to have the more general one as first;
- tagged the rule as clean for arm.
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 automation/eclair_analysis/ECLAIR/tagging.ecl    | 2 +-
 docs/misra/deviations.rst                        | 8 +++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index d21f112a9b..db1fae3aa2 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -343,6 +343,10 @@ statements are deliberate"
 -config=MC3R1.R14.3,statements={deliberate , "wrapped(any(),node(if_stmt))" }
 -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
+
 -doc_begin="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"
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index bdf94ed996..f573b32da4 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -29,7 +29,7 @@ if(string_equal(target,"x86_64"),
 )
 
 if(string_equal(target,"arm64"),
-    service_selector({"additional_clean_guidelines","MC3R1.R16.6||MC3R1.R20.12||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R8.6||MC3R1.R9.3"})
+    service_selector({"additional_clean_guidelines","MC3R1.R14.4||MC3R1.R16.6||MC3R1.R20.12||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R8.6||MC3R1.R9.3"})
 )
 
 -reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index ed0c1e8ed0..c4e304fc44 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -290,11 +290,17 @@ Deviations related to MISRA C:2012 Rules:
        statements are deliberate.
      - Project-wide deviation; tagged as `disapplied` 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.
+
    * - R14.4
      - 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.
 
    * - R16.2
      - Complying with the Rule would entail a lot of code duplication in the
-- 
2.34.1



             reply	other threads:[~2024-05-02 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 13:11 Federico Serafini [this message]
2024-05-02 18:19 ` [XEN PATCH v2] automation/eclair: add deviation of MISRA C:2012 Rule 14.4 Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce16233b539f4101d97b3e2962607c87b188c415.1714655082.git.federico.serafini@bugseng.com \
    --to=federico.serafini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=simone.ballarin@bugseng.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).