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

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



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@xxxxxxx>
---
 xen/include/xen/compiler.h | 1 +
 1 file changed, 1 insertion(+)

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
-- 
2.17.1




 


Rackspace

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