[PATCH] docs/misra: add 13.6 to rules.rst

Stefano Stabellini posted 1 patch 4 weeks ago
Failed in applying to current master (apply log)
[PATCH] docs/misra: add 13.6 to rules.rst
Posted by Stefano Stabellini 4 weeks ago
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.)

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
Re: [PATCH] docs/misra: add 13.6 to rules.rst
Posted by Jan Beulich 4 weeks ago
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
Re: [PATCH] docs/misra: add 13.6 to rules.rst
Posted by Stefano Stabellini 3 weeks, 6 days ago
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