Skip to contentSkip to conversation

include : compile warning by __const_hweight8

PATCH New Namjae Jeon 1 participant 1 message Jul 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include : compile warning by __const_hweight8

The compilation warning is caused by __const_hweight8 when using hweight_long with -Wsign-compare option. The reason is that the default return value of this macro is signed. So, need tye casting to remove warning.

---
 include/asm-generic/bitops/const_hweight.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/bitops/const_hweight.h +1 -1
index fa2a50b..d91b1aa 100644
@@ -4,7 +4,7 @@
 /*
  * Compile time versions of __arch_hweightN()
  */
-#define __const_hweight8(w)		\
+#define __const_hweight8(w) (unsigned long)	\
       (	(!!((w) & (1ULL << 0))) +	\
 	(!!((w) & (1ULL << 1))) +	\
 	(!!((w) & (1ULL << 2))) +	\
Signature · 1 line
1.7.4.4