|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH 02/11] x86: move declarations to address MISRA C:2012 Rule 2.1
On Thu, 3 Aug 2023, Stefano Stabellini wrote:
> > Actually, they can be deviated because they don't result in wrong code being
> > generated.
> > This, modulo the review comments received, is what most of the code would
> > look
> > like if
> > they weren't, with the biggest pain point being that in many cases the
> > choice
> > is either
> > the pattern with blocks for certain clauses or moving them in the enclosing
> > scope, which may
> > be several hundred lines above. If there's agreement on deviating them, I
> > can
> > drop the patches
> > dealing with switches and do a v2 with just the other modifications.
>
> I think we should deviate them. Good idea to remove them in v2.
We should add a note about this to docs/misra/rules.rst as well?
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 8f0e4d3f25..e713b0ea99 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -106,7 +106,8 @@ maintainers if you want to suggest a change.
* - `Rule 2.1
<https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_01_1.c>`_
- Required
- A project shall not contain unreachable code
- -
+ - It is acceptable to declare local variables under a switch
+ statement block
* - `Rule 2.6
<https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_06.c>`_
- Advisory
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |