diff mbox series

docs/misra: add R16.2 and R16.3

Message ID alpine.DEB.2.22.394.2311141511510.160649@ubuntu-linux-20-04-desktop (mailing list archive)
State New, archived
Headers show
Series docs/misra: add R16.2 and R16.3 | expand

Commit Message

Stefano Stabellini Nov. 14, 2023, 11:12 p.m. UTC
For Rule 16.2 deviate xen/arch/x86/x86_emulate.
For Rule 16.2 allow control flow statements and terminals. For the rest,
request the "fallthrough" psedo-keyword to be used.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/rules.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 375a886607..926ecc9d82 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -462,6 +462,20 @@  maintainers if you want to suggest a change.
 
        while(0) and while(1) and alike 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
+     - xen/arch/x86/x86_emulate/ doesn't follow this guideline
+
+   * - `Rule 16.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_03.c>`_
+     - Required
+     - An unconditional break statement shall terminate every
+       switch-clause
+     - Control flow statements (goto, return, continue) and terminals
+       (BUG()) are permitted. Other cases shall have the pseudo-keyword
+       "fallthrough".
+
    * - `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