diff mbox series

docs/misra: add 13.6 to rules.rst

Message ID alpine.DEB.2.22.394.2404021618030.2245130@ubuntu-linux-20-04-desktop (mailing list archive)
State New, archived
Headers show
Series docs/misra: add 13.6 to rules.rst | expand

Commit Message

Stefano Stabellini April 2, 2024, 11:21 p.m. UTC
As agreed during MISRA C meetings, add Rule 13.6 to rules.rst.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
There was a request to expand the scope to also include alignof and
typeof. Depending on whether the MISRA C scanners support it, and under
which rules violations will be listed, rules.rst will be updated
accordingly (either updating the notes section of 13.6 or adding a new
entry.)

Comments

Jan Beulich April 3, 2024, 6:22 a.m. UTC | #1
On 03.04.2024 01:21, Stefano Stabellini wrote:
> As agreed during MISRA C meetings, add Rule 13.6 to rules.rst.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
> There was a request to expand the scope to also include alignof and
> typeof. Depending on whether the MISRA C scanners support it, and under
> which rules violations will be listed, rules.rst will be updated
> accordingly (either updating the notes section of 13.6 or adding a new
> entry.)

Hmm. Imo ...

> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -445,6 +445,12 @@ maintainers if you want to suggest a change.
>       - Initializer lists shall not contain persistent side effects
>       -
>  
> +   * - `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
> +       expression which has potential side-effects
> +     -

... a note to this effect should be put here right away. We _want_ to
respect the rule for the other two similar keywords, after all. What we
don't know at this point is whether we can get help towards this from
Eclair.

With such a note added:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Stefano Stabellini April 3, 2024, 11:20 p.m. UTC | #2
On Wed, 3 Apr 2024, Jan Beulich wrote:
> On 03.04.2024 01:21, Stefano Stabellini wrote:
> > As agreed during MISRA C meetings, add Rule 13.6 to rules.rst.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> > ---
> > There was a request to expand the scope to also include alignof and
> > typeof. Depending on whether the MISRA C scanners support it, and under
> > which rules violations will be listed, rules.rst will be updated
> > accordingly (either updating the notes section of 13.6 or adding a new
> > entry.)
> 
> Hmm. Imo ...
> 
> > --- a/docs/misra/rules.rst
> > +++ b/docs/misra/rules.rst
> > @@ -445,6 +445,12 @@ maintainers if you want to suggest a change.
> >       - Initializer lists shall not contain persistent side effects
> >       -
> >  
> > +   * - `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
> > +       expression which has potential side-effects
> > +     -
> 
> ... a note to this effect should be put here right away. We _want_ to
> respect the rule for the other two similar keywords, after all. What we
> don't know at this point is whether we can get help towards this from
> Eclair.
> 
> With such a note added:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Turns out 13.6 was already in rules.rst and I didn't notice it
immediately because it was not in order. So as I commit this patch I
took the opportunity to remove the older out of order entry, and also
add the note as requested
diff mbox series

Patch

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 1e134ccebc..415b5b63c3 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -445,6 +445,12 @@  maintainers if you want to suggest a change.
      - Initializer lists shall not contain persistent side effects
      -
 
+   * - `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
+       expression which has potential side-effects
+     -
+
    * - `Rule 14.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_14_01.c>`_
      - Required
      - A loop counter shall not have essentially floating type