diff mbox series

[RFC,07/18] xen: cppcheck: misra rule 20.7 deviation on compiler.h

Message ID 20221220085100.22848-8-luca.fancellu@arm.com (mailing list archive)
State Superseded
Headers show
Series cppcheck rule 20.7 fixes | expand

Commit Message

Luca Fancellu Dec. 20, 2022, 8:50 a.m. UTC
Cppcheck has found a violation of rule 20.7 for the macro
sizeof_field, but the parenthesis cannot be applied on the second
operand of a member access operator, hence we can suppress the
finding.

Eclair and coverity does not report this finding.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/include/xen/compiler.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index a5631303348b..301ba55d6ecc 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -115,6 +115,7 @@ 
  * @TYPE: The structure containing the field of interest
  * @MEMBER: The field to return the size of
  */
+/* SAF-0-false-positive-cppcheck R20.7 member-access operator */
 #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
 
 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L