All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, "Roger Pau Monné" <roger.pau@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>
Subject: docs/misra: add R21.6 R21.14 R21.15 R21.16
Date: Tue, 16 Apr 2024 12:27:38 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2404161227340.2257106@ubuntu-linux-20-04-desktop> (raw)

Also add two specific project-wide deviations for R21.6 and R21.15.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 32b02905d1..9123c8edb5 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -387,6 +387,22 @@ Deviations related to MISRA C:2012 Rules:
        of the Rule due to uses of this macro.
      - Tagged as `deliberate` for ECLAIR.
 
+   * - R21.6
+     - The use of snprintf() and vsnprintf() is justifiable as, despite
+       the fact that such functions have the same names of the
+       corresponding standard library functions, each configuration of
+       Xen has a unique implementation for them; the code implementing
+       such functions is subject to the analysis, so that any undefined
+       or unspecified behavior associated to them falls under the
+       responsibility of other MISRA guidelines
+     - Tagged as `safe` for ECLAIR.
+
+   * - R21.15
+     - The use of void* arguments is justifiable as the rationale for
+       the rule is to indicate possible mistakes, and void* is
+       frequently used in Xen to represent virtual memory addresses
+     - Tagged as `deliberate` for ECLAIR.
+
 Other deviations:
 -----------------
 
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b7b447e152..00db02ad34 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -652,12 +652,38 @@ maintainers if you want to suggest a change.
        declared
      - See comment for Rule 21.1
 
+   * - `Rule 21.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_06.c>`_
+     - Required
+     - The Standard Library input/output routines shall not be used
+     - See the snprintf() and vsnprintf() deviation in deviations.rst
+
    * - `Rule 21.13 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_13.c>`_
      - Mandatory
      - Any value passed to a function in <ctype.h> shall be representable as an
        unsigned char or be the value EOF
      -
 
+   * - `Rule 21.14 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_14.c>`_
+     - Required
+     - The Standard Library function memcmp shall not be used to compare
+       null terminated strings
+     -
+
+   * - `Rule 21.15 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_15.c>`_
+     - Required
+     - The pointer arguments to the Standard Library functions memcpy,
+       memmove and memcmp shall be pointers to qualified or unqualified
+       versions of compatible types 
+     - void* arguments are allowed, see deviations.rst
+
+   * - `Rule 21.16 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_16.c>`_
+     - Required
+     - The pointer arguments to the Standard Library function memcmp
+       shall point to either a pointer type, an essentially signed type,
+       an essentially unsigned type, an essentially Boolean type or an
+       essentially enum type 
+     -
+
    * - `Rule 21.17 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_17.c>`_
      - Mandatory
      - Use of the string handling functions from <string.h> shall not result in


             reply	other threads:[~2024-04-16 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 19:27 Stefano Stabellini [this message]
2024-04-17  7:58 ` docs/misra: add R21.6 R21.14 R21.15 R21.16 Luca Fancellu
2024-04-17 15:01 ` Julien Grall
2024-04-17 19:10   ` Stefano Stabellini
2024-04-17 21:05     ` Julien Grall
2024-04-17 21:13       ` Stefano Stabellini
2024-04-18  6:40         ` Nicola Vetrini
2024-04-18  9:53 ` Jan Beulich
2024-04-25  0:42   ` 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=alpine.DEB.2.22.394.2404161227340.2257106@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.