]> xenbits.xensource.com Git - xen.git/commitdiff
docs/misra: add rule 12.2
authorStefano Stabellini <sstabellini@kernel.org>
Fri, 12 Jul 2024 22:45:54 +0000 (15:45 -0700)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 30 Jul 2024 22:14:31 +0000 (15:14 -0700)
As discussed during the last MISRA C meeting, add Rule 12.2 to the list
of MISRA C rules we accept, together with an explanation that we use gcc
-fsanitize=undefined to check for violations.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
docs/misra/rules.rst

index 2e11566e20201c27071d712b210afd27dba53601..bb7e1ea39612a8462ffe5ab37c3fcd58ea23ea35 100644 (file)
@@ -443,6 +443,14 @@ maintainers if you want to suggest a change.
      - The macro NULL shall be the only permitted form of null pointer constant
      -
 
+   * - `Rule 12.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_02.c>`_
+     - Required
+     - The right hand operand of a shift operator shall lie in the range
+       zero to one less than the width in bits of the essential type of
+       the left hand operand
+     - We rely on gcc -fsanitize=undefined to check for dangerious
+       violations to this rule and to ensure compliance
+
    * - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
      - Mandatory
      - The sizeof operator shall not have an operand which is a function