]> xenbits.xensource.com Git - xen.git/commitdiff
automation/eclair_analysis: deviate and|or|xor|not for MISRA C Rule 21.2
authorAlessandro Zucchelli <alessandro.zucchelli@bugseng.com>
Tue, 25 Jun 2024 20:41:27 +0000 (13:41 -0700)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 25 Jun 2024 20:41:27 +0000 (13:41 -0700)
Rule 21.2 reports identifiers reserved for the C and POSIX standard
libraries: or, and, not and xor are reserved identifiers because they
constitute alternate spellings for the corresponding operators (they are
defined as macros by iso646.h); however Xen doesn't use standard library
headers, so there is no risk of overlap.

This addresses violations arising from x86_emulate/x86_emulate.c, where
label statements named as or, and and xor appear.

No functional change.

Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
automation/eclair_analysis/ECLAIR/deviations.ecl

index 8f13dabeb10259ce78f48bc5b32d0d19f3c71923..dcff4f40136cb925969f9c81dcfa706254200528 100644 (file)
@@ -523,6 +523,12 @@ in the expansion."
 # Series 21.
 #
 
+-doc_begin="or, and and xor are reserved identifiers because they constitute alternate
+spellings for the corresponding operators (they are defined as macros by iso646.h).
+However, Xen doesn't use standard library headers, so there is no risk of overlap."
+-config=MC3R1.R21.2,reports+={safe, "any_area(stmt(ref(kind(label)&&^(or|and|xor|not)$)))"}
+-doc_end
+
 -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