diff mbox series

[v3] docs/misra: add R13.2 and R18.2 to rules.rst

Message ID alpine.DEB.2.22.394.2408011218250.114241@ubuntu-linux-20-04-desktop (mailing list archive)
State New
Headers show
Series [v3] docs/misra: add R13.2 and R18.2 to rules.rst | expand

Commit Message

Stefano Stabellini Aug. 1, 2024, 7:19 p.m. UTC
Add MISRA C rules 13.2 and 18.2 to rules.rst. Both rules have zero
violations reported by Eclair but they have some cautions. We accept
both rules and for now we'll enable scanning for them in Eclair but only
violations will cause the Gitlab CI job to fail (cautions will not.)

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v3:
- improve notes
Changes in v2:
- clarify that new code is expected to follow the rule
---
 docs/misra/rules.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Bertrand Marquis Aug. 2, 2024, 6:47 a.m. UTC | #1
Hi Stefano,

> On 1 Aug 2024, at 21:19, Stefano Stabellini <sstabellini@kernel.org> wrote:
> 
> Add MISRA C rules 13.2 and 18.2 to rules.rst. Both rules have zero
> violations reported by Eclair but they have some cautions. We accept
> both rules and for now we'll enable scanning for them in Eclair but only
> violations will cause the Gitlab CI job to fail (cautions will not.)
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand


> ---
> Changes in v3:
> - improve notes
> Changes in v2:
> - clarify that new code is expected to follow the rule
> ---
> docs/misra/rules.rst | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
> 
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 7b366edb07..e99cb81089 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -462,6 +462,16 @@ maintainers if you want to suggest a change.
>      - Initializer lists shall not contain persistent side effects
>      -
> 
> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
> +     - Required
> +     - The value of an expression and its persistent side-effects shall
> +       be the same under all permitted evaluation orders
> +     - Be aware that the static analysis tool Eclair might report
> +       several findings for Rule 13.2 of type "caution". These are
> +       instances where Eclair is unable to verify that the code is valid
> +       in regard to Rule 13.2. Caution reports might not be violations.
> +       The rule should be followed in any case in new code submitted.
> +
>    * - `Rule 13.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_06.c>`_
>      - Required
>      - The operand of the sizeof operator shall not contain any
> @@ -583,6 +593,16 @@ maintainers if you want to suggest a change.
>        submitting new patches please try to decrease the number of
>        violations when possible.
> 
> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
> +     - Required
> +     - Subtraction between pointers shall only be applied to pointers
> +       that address elements of the same array
> +     - Be aware that the static analysis tool Eclair might report
> +       several findings for Rule 18.2 of type "caution". These are
> +       instances where Eclair is unable to verify that the code is valid
> +       in regard to Rule 18.2. Caution reports might not be violations.
> +       The rule should be followed in any case in new code submitted.
> +
>    * - `Rule 18.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_03.c>`_
>      - Required
>      - The relational operators > >= < and <= shall not be applied to objects of pointer type except where they point into the same object
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 7b366edb07..e99cb81089 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -462,6 +462,16 @@  maintainers if you want to suggest a change.
      - Initializer lists shall not contain persistent side effects
      -
 
+   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
+     - Required
+     - The value of an expression and its persistent side-effects shall
+       be the same under all permitted evaluation orders
+     - Be aware that the static analysis tool Eclair might report
+       several findings for Rule 13.2 of type "caution". These are
+       instances where Eclair is unable to verify that the code is valid
+       in regard to Rule 13.2. Caution reports might not be violations.
+       The rule should be followed in any case in new code submitted.
+
    * - `Rule 13.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_06.c>`_
      - Required
      - The operand of the sizeof operator shall not contain any
@@ -583,6 +593,16 @@  maintainers if you want to suggest a change.
        submitting new patches please try to decrease the number of
        violations when possible.
 
+   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
+     - Required
+     - Subtraction between pointers shall only be applied to pointers
+       that address elements of the same array
+     - Be aware that the static analysis tool Eclair might report
+       several findings for Rule 18.2 of type "caution". These are
+       instances where Eclair is unable to verify that the code is valid
+       in regard to Rule 18.2. Caution reports might not be violations.
+       The rule should be followed in any case in new code submitted.
+
    * - `Rule 18.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_03.c>`_
      - Required
      - The relational operators > >= < and <= shall not be applied to objects of pointer type except where they point into the same object