]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
automation/eclair_analysis: fully deviate MISRA C Rules 21.9 and 21.10
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Wed, 15 May 2024 07:51:59 +0000 (09:51 +0200)
committerStefano Stabellini <stefano.stabellini@amd.com>
Wed, 15 May 2024 23:58:06 +0000 (16:58 -0700)
These rules are concerned with the use of facilities provided by the
C Standard Library (qsort, bsearch for rule 21.9, and those provided
by <time.h> for rule 21.10).

Xen provides in its source code its own implementation of some of these
functions and macros, therefore a justification is provided for allowing
uses of these functions in the project.

The rules are also marked as clean as a consequence.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
automation/eclair_analysis/ECLAIR/deviations.ecl
automation/eclair_analysis/ECLAIR/monitored.ecl
automation/eclair_analysis/ECLAIR/tagging.ecl
docs/misra/deviations.rst

index 5eb7368a732232680b6724c2c068a901fc676a5c..1478c64a5af12b9537b9165cea81a10827146fb0 100644 (file)
@@ -477,6 +477,20 @@ leads to a violation of the Rule are deviated."
 -config=MC3R1.R20.12,macros+={deliberate, "name(GENERATE_CASE)&&loc(file(deliberate_generate_case))"}
 -doc_end
 
+#
+# Series 21.
+#
+
+-doc_begin="Xen does not use the functions provided by the Standard Library, but
+implements a set of functions that share the same names as their Standard Library equivalent.
+The implementation of these functions is available in source form, so the undefined, unspecified
+or implementation-defined behaviors contemplated by the C Standard do not apply.
+If some undefined or unspecified behavior does arise in the implementation, it
+falls under the jurisdiction of other MISRA rules."
+-config=MC3R1.R21.9,reports+={deliberate, "any()"}
+-config=MC3R1.R21.10,reports+={deliberate, "any()"}
+-doc_end
+
 #
 # General
 #
index 69308ea51c013e15043b39a61473e3dd98ec87de..9da709dc889c594c287d432d7ec047a77a02b84c 100644 (file)
 -enable=MC3R1.R20.4
 -enable=MC3R1.R20.9
 -enable=MC3R1.R2.1
+-enable=MC3R1.R21.10
 -enable=MC3R1.R21.13
 -enable=MC3R1.R21.17
 -enable=MC3R1.R21.18
 -enable=MC3R1.R21.19
 -enable=MC3R1.R21.20
 -enable=MC3R1.R21.21
+-enable=MC3R1.R21.9
 -enable=MC3R1.R2.2
 -enable=MC3R1.R22.2
 -enable=MC3R1.R22.4
index a14bda5033dfa58bac05d7035167f95b7851002f..acea15f486a119c93bd6558a6fd4e395764294c0 100644 (file)
@@ -19,7 +19,7 @@
 
 -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
 
--service_selector={clean_guidelines_common, "MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.2||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5"
+-service_selector={clean_guidelines_common, "MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.10||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R21.9||MC3R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.2||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5"
 }
 
 -setq=target,getenv("XEN_TARGET_ARCH")
index 161134771c776122fe8f8c16a03a885828267e53..b5450c38f66c27d2dd2ae4994388cf8ab5b1bb59 100644 (file)
@@ -411,6 +411,24 @@ Deviations related to MISRA C:2012 Rules:
        construct is deviated only in Translation Units that present a violation
        of the Rule due to uses of this macro.
      - Tagged as `deliberate` for ECLAIR.
+     
+   * - R21.9
+     - Xen does not use the `bsearch` and `qsort` functions provided by the C
+       Standard Library, but provides in source form its own implementation,
+       therefore any unspecified or undefined behavior associated to the
+       functions provided by the Standard Library does not apply. Any such
+       behavior that may exist in such functions is therefore under the
+       jurisdiction of other MISRA C rules.
+     - Project-wide deviation, tagged as `deliberate` for ECLAIR.
+
+   * - R21.10
+     - Xen does not use the facilities provided by the `\<time.h\>` provided by the C
+       Standard Library, but provides in source form its own implementation,
+       therefore any unspecified, undefined or implementation-defined behavior
+       associated to the functions provided by the Standard Library does not
+       apply. Any such behavior that may exist in such functions is therefore
+       under the jurisdiction of other MISRA C rules.
+     - Project-wide deviation, tagged as `deliberate` for ECLAIR.
 
 Other deviations:
 -----------------