]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
docs/misra: add rule 2.1 exceptions
authorStefano Stabellini <stefano.stabellini@amd.com>
Wed, 23 Aug 2023 22:39:42 +0000 (15:39 -0700)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 29 Sep 2023 18:00:47 +0000 (11:00 -0700)
During the discussions that led to the acceptance of Rule 2.1, we
decided on a few exceptions that were not properly recorded in
rules.rst. Add them now.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
docs/misra/rules.rst

index 661aa95e235a9502363f2ff897c5e4f5306c0266..a2fe01464eecd5f2b649fd81cf97bba91debd939 100644 (file)
@@ -107,7 +107,16 @@ 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
-     -
+     - The following are allowed:
+         - Invariantly constant conditions, e.g. if(IS_ENABLED(CONFIG_HVM)) { S; }
+         - Switch with a controlling value statically determined not to
+           match one or more case statements
+         - Functions that are intended to be referenced only from
+           assembly code (e.g. 'do_trap_fiq')
+         - asm-offsets.c, as they are not linked deliberately, because
+           they are used to generate definitions for asm modules
+         - Declarations without initializer are safe, as they are not
+           executed
 
    * - `Rule 2.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_06.c>`_
      - Advisory