Re: rdma-core compiler warnings on RHEL6.8

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

 



On Fri, Apr 13, 2018 at 12:38:13PM -0500, Steve Wise wrote:
> Hey guys, compiling rdma-core on RHEL6.8 shows at least two sets of
> warnings.   Should these be fixed?

No, I ignore almost all warnings from that old compiler.

> 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

The code is right as is, as the standard does not require all
implementations to use unsigned storage for an enum. Newer compilers
must be supressing this as bogus because it is true.

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

aliasing analysis is pretty broken in that compiler.

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