[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2



Rule 21.2 reports identifiers reserved for the C and POSIX standard
libraries: or, and and xor are reserved identifiers because they constitute
alternate spellings for the corresponding operators; 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@xxxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 9fa9a7f01c..069519e380 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -498,6 +498,12 @@ still remain available."
 -config=MC3R1.R21.2,declarations+={safe, "!^__builtin_.*$"}
 -doc_end
 
+-doc_begin="or, and and xor are reserved identifiers because they constitute 
alternate
+spellings for the corresponding operators.
+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)$)))"}
+-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
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.