rdma-core compiler warnings on RHEL6.8

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

 



Hey guys, compiling rdma-core on RHEL6.8 shows at least two sets of
warnings.   Should these be fixed?

1) enum type treated as a signed int:

/root/stevo/rdma-core/libibverbs/enum_strs.c: In function
'ibv_port_state_str':
/root/stevo/rdma-core/libibverbs/enum_strs.c:63: warning: comparison of
unsigned expression < 0 is always false
/root/stevo/rdma-core/libibverbs/enum_strs.c: In function
'ibv_event_type_str':
/root/stevo/rdma-core/libibverbs/enum_strs.c:94: warning: comparison of
unsigned expression < 0 is always false
/root/stevo/rdma-core/libibverbs/enum_strs.c: In function
'ibv_wc_status_str':
/root/stevo/rdma-core/libibverbs/enum_strs.c:129: warning: comparison of
unsigned expression < 0 is always false

2) strict aliasing warnings:

/root/stevo/rdma-core/libibverbs/verbs.c: In function 'ibv_init_ah_from_wc':
/root/stevo/rdma-core/libibverbs/verbs.c:648: warning: dereferencing pointer
'sgid.163' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/verbs.c:647: warning: dereferencing pointer
'sgid.163' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/verbs.c:646: warning: dereferencing pointer
'sgid.163' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/verbs.c:645: warning: dereferencing pointer
'sgid.163' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/verbs.c:724: note: initialized from here

I avoided #2 by adding this...but is there some way to do this only for
certain compilers?

diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt
index 7218783..29998f6 100644
--- a/libibverbs/CMakeLists.txt
+++ b/libibverbs/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}")
+
 publish_headers(infiniband
   arch.h
   opcode.h

---
Steve.

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