diff mbox series

docs/misra/rules.rst: add Rule 16.2

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

Commit Message

Stefano Stabellini Dec. 8, 2023, 12:18 a.m. UTC
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Comments

Julien Grall Dec. 15, 2023, 10:09 a.m. UTC | #1
Hi Stefano,

On 08/12/2023 00:18, Stefano Stabellini wrote:
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,
diff mbox series

Patch

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 2b570af0e0..7cb9544a96 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -469,6 +469,15 @@  maintainers if you want to suggest a change.
      - In addition to break, also other flow control statements such as
        continue, return, goto are allowed.
 
+   * - `Rule 16.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_02.c>`_
+     - Required
+     - A switch label shall only be used when the most closely-enclosing
+       compound statement is the body of a switch statement
+     - The x86 emulator (xen/arch/x86/x86_emulate*) is exempt from
+       compliance with this rule. Efforts to make the x86 emulator
+       adhere to Rule 16.2 would result in increased complexity and
+       maintenance difficulty, and could potentially introduce bugs. 
+
    * - `Rule 16.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_07.c>`_
      - Required
      - A switch-expression shall not have essentially Boolean type