diff mbox

rdma-core compiler warnings on RHEL6.8

Message ID 007101d3d37f$4ffdb250$eff916f0$@opengridcomputing.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Steve Wise April 13, 2018, 11:29 p.m. UTC
> 
> If you can make a simple test program that triggers the above warning
> send it to me and I will make cmake turn off strict aliasing globally if
the
> compiler is too old..
> 
> Jason
>

Hey Jason,

Attached is bar.c, that if you build in libibverbs/examples, will show these
two warnings.  

EG:

index dc4c497..84b5813 100644
+rdma_executable(bar bar.c)

----

 [ 84%] Building C object libibverbs/examples/CMakeFiles/bar.dir/bar.c.o
/root/stevo/rdma-core/libibverbs/examples/bar.c: In function 'bar':
/root/stevo/rdma-core/libibverbs/examples/bar.c:67: warning: comparison of
unsigned expression < 0 is always false
/root/stevo/rdma-core/libibverbs/examples/bar.c: In function 'main':
/root/stevo/rdma-core/libibverbs/examples/bar.c:43: warning: dereferencing
pointer 'sgid.103' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/examples/bar.c:42: warning: dereferencing
pointer 'sgid.103' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/examples/bar.c:41: warning: dereferencing
pointer 'sgid.103' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/examples/bar.c:44: warning: dereferencing
pointer 'sgid.103' does break strict-aliasing rules
/root/stevo/rdma-core/libibverbs/examples/bar.c:51: note: initialized from
here
Linking C executable ../../bin/bar

---

Thanks!

Steve.
diff mbox

Patch

--- a/libibverbs/examples/CMakeLists.txt
+++ b/libibverbs/examples/CMakeLists.txt
@@ -26,3 +26,4 @@  target_link_libraries(ibv_ud_pingpong LINK_PRIVATE ibverbs
ibverbs_tools)

 rdma_executable(ibv_xsrq_pingpong xsrq_pingpong.c)
 target_link_libraries(ibv_xsrq_pingpong LINK_PRIVATE ibverbs ibverbs_tools)