[RFC PATCH 04/18] arm: cppcheck: misra rule 20.7 deviation on config.h

Luca Fancellu posted 18 patches 3 years, 1 month ago
There is a newer version of this series
[RFC PATCH 04/18] arm: cppcheck: misra rule 20.7 deviation on config.h
Posted by Luca Fancellu 3 years, 1 month ago
Cppcheck has found violations of rule 20.7 for the macros ENTRY(),
GLOBAL(), END() and ENDPROC(), but the macro parameters are never
used as an expression, they are used for text substitution but
cppcheck is not taking into account the context of them, so we can
suppress the findings.

Eclair and coverity does not report these findings.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/include/asm/config.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 0fefed1b8aa9..c4843ddffe24 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -54,15 +54,19 @@
 /* Linkage for ARM */
 #ifdef __ASSEMBLY__
 #define ALIGN .align 2
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define ENTRY(name)                             \
   .globl name;                                  \
   ALIGN;                                        \
   name:
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define GLOBAL(name)                            \
   .globl name;                                  \
   name:
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define END(name) \
   .size name, .-name
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define ENDPROC(name) \
   .type name, %function; \
   END(name)
-- 
2.17.1