|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] xen:add deviations for MISRA C 2012 Rule R5.2
This addresses violations of MISRA C:2012 Rule 5.2 which states as
following: Identifiers declared in the same scope and name space shall
be distinct.
This deviation addresses violations of Rule 5.2 arising from
identifiers generated through token pasting macros CHECK_NAME_ and
DEFINE_COMPAT_HANDLE.
No functional change.
Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
docs/misra/deviations.rst | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c5663eed2b..ee1ac3b602 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -88,6 +88,10 @@ it defines would (in the common case) be already defined.
Peer reviewed by the c
# Series 5.
#
+-doc_begin="Identifiers generated through the following token pasting macros
are excluded from compliance to this rule"
+-config=MC3R1.R5.2,reports+={safe,
"any_area(any_loc(any_exp(macro(^CHECK_NAME_$))&&any_exp(macro(^DEFINE_COMPAT_HANDLE$))))"}
+-doc_end
+
-doc_begin="The project adopted the rule with an exception listed in
'docs/misra/rules.rst'"
-config=MC3R1.R5.3,reports+={safe,
"any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 15a993d050..aa98acc45f 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -97,6 +97,13 @@ Deviations related to MISRA C:2012 Rules:
are not instances of commented-out code.
- Tagged as `safe` for ECLAIR.
+ * - R5.2
+ - Macros CHECK_NAME_ and DEFINE_COMPAT_HANDLE through token pasting
+ generate non-compliant identifiers. Such identifiers are allowed.
+ - Tagged as `safe` for ECLAIR. So far, the following macros are deviated:
+ - CHECK_NAME_
+ - DEFINE_COMPAT_HANDLE
+
* - R5.3
- As specified in rules.rst, shadowing due to macros being used as macro
arguments is allowed, as it's deemed not at risk of causing developer
--
2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |