[PATCH v2] docs/misra: add Rule 1.1 and 5.6

Stefano Stabellini posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230721221636.3693746-1-sstabellini@kernel.org
docs/misra/rules.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
[PATCH v2] docs/misra: add Rule 1.1 and 5.6
Posted by Stefano Stabellini 9 months, 1 week ago
From: Stefano Stabellini <stefano.stabellini@amd.com>

Rule 1.1 is uncontroversial and we are already following it.

Rule 5.6 has been deemed a good rule to have by the MISRA C group.
However, we do have a significant amount of violations that will take
time to resolve and might require partial deviations in the form of
in-code comments or MISRA C scanners special configurations (ECLAIR).
For new code, we want this rule to generally apply hence the addition to
docs/misra/rules.rst.

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

---
Changes in v2:
- add a note about compiler extensions to Rule 1.1
- add "generally" in the commit message
---
 docs/misra/rules.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 29a777938a..8f0e4d3f25 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -82,6 +82,14 @@ maintainers if you want to suggest a change.
      - Summary
      - Notes
 
+   * - `Rule 1.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_01.c>`_
+     - Required
+     - The program shall contain no violations of the standard C syntax
+       and constraints, and shall not exceed the implementation's
+       translation limits
+     - We make use of several compiler extensions as documented by
+       `C-language-toolchain.rst <docs/misra/C-language-toolchain.rst>`_
+
    * - `Rule 1.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_03.c>`_
      - Required
      - There shall be no occurrence of undefined or critical unspecified
@@ -156,6 +164,11 @@ maintainers if you want to suggest a change.
        headers (xen/include/public/) are allowed to retain longer
        identifiers for backward compatibility.
 
+   * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_
+     - Required
+     - A typedef name shall be a unique identifier
+     -
+
    * - `Rule 6.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_06_01.c>`_
      - Required
      - Bit-fields shall only be declared with an appropriate type
-- 
2.25.1
Re: [PATCH v2] docs/misra: add Rule 1.1 and 5.6
Posted by Jan Beulich 9 months, 1 week ago
On 22.07.2023 00:16, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> Rule 1.1 is uncontroversial and we are already following it.
> 
> Rule 5.6 has been deemed a good rule to have by the MISRA C group.
> However, we do have a significant amount of violations that will take
> time to resolve and might require partial deviations in the form of
> in-code comments or MISRA C scanners special configurations (ECLAIR).
> For new code, we want this rule to generally apply hence the addition to
> docs/misra/rules.rst.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>