[PATCH] verbs: fix compilation error with ICC

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

 



Compiling a program including verbs.h with ICC fails with the following
error (seen with DPDK):

 /root/development/rdma-core/build/include/infiniband/verbs.h(84):
 warning #61: integer operation result is out of range
   static void *__VERBS_ABI_IS_EXTENDED = ((uint8_t *) NULL) - 1;

Fixes: 6be16586e081 ("Infrastructure to support verbs extensions")
Cc: yishaih@xxxxxxxxxxxx

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@xxxxxxxxx>
Acked-by: Adrien Mazarguil <adrien.mazarguil@xxxxxxxxx>
---
 libibverbs/verbs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 8cdf8ab..cc633a1 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -42,6 +42,7 @@
 #include <errno.h>
 #include <string.h>
 #include <linux/types.h>
+#include <stdint.h>
 
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
@@ -81,7 +82,7 @@ union ibv_gid {
 
 #define vext_field_avail(type, fld, sz) (offsetof(type, fld) < (sz))
 
-static void *__VERBS_ABI_IS_EXTENDED = ((uint8_t *) NULL) - 1;
+static void *__VERBS_ABI_IS_EXTENDED = (void *)UINTPTR_MAX;
 
 enum ibv_node_type {
 	IBV_NODE_UNKNOWN	= -1,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux