The TYPE_IS_SIGNED macro does a less than zero comparision with an
unsigned type which can cause compiler warnings like the following:

lib/tag.c:100:9: error: comparison of unsigned expression < 0 is
always false [-Werror=type-limits]
---
 lib/type-props.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/type-props.h b/lib/type-props.h
index 9225041..5c75d9f 100644
--- a/lib/type-props.h
+++ b/lib/type-props.h
@@ -20,7 +20,7 @@
 #include <limits.h>
 
 #define TYPE_IS_INTEGER(TYPE) ((TYPE) 1.5 == (TYPE) 1)
-#define TYPE_IS_SIGNED(TYPE) ((TYPE) 0 > (TYPE) -1)
+#define TYPE_IS_SIGNED(TYPE) ((TYPE) 1 > (TYPE) -1)
 #define TYPE_VALUE_BITS(TYPE) (sizeof(TYPE) * CHAR_BIT - TYPE_IS_SIGNED(TYPE))
 #define TYPE_MINIMUM(TYPE) (TYPE_IS_SIGNED(TYPE) \
                             ? ~(TYPE)0 << TYPE_VALUE_BITS(TYPE) \
-- 
1.7.6.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to