Re: [PATCH 2/6] Cast poniter type

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

 



On 7/26/2018 12:12 PM, Jason Gunthorpe wrote:
> On Thu, Jul 26, 2018 at 06:56:14AM -0400, Hal Rosenstock wrote:
>> On 7/19/2018 10:50 PM, Honggang LI wrote:
>>> From: Honggang Li <honli@xxxxxxxxxx>
>>>
>>> make[2]: Entering directory '/home/honli/upstream-repos/opensm/libvendor'
>>> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I../include/opensm  -I./../include -I./../../libibumad/include -I/usr/local/include  -Werror -Wall -Wwrite-strings -g -g -O2 -MT libosmvendor_la-osm_vendor_ibumad.lo -MD -MP -MF .deps/libosmvendor_la-osm_vendor_ibumad.Tpo -c -o libosmvendor_la-osm_vendor_ibumad.lo `test -f 'osm_vendor_ibumad.c' || echo './'`osm_vendor_ibumad.c
>>> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I../include/opensm -I./../include -I./../../libibumad/include -I/usr/local/include -Werror -Wall -Wwrite-strings -g -g -O2 -MT libosmvendor_la-osm_vendor_ibumad.lo -MD -MP -MF .deps/libosmvendor_la-osm_vendor_ibumad.Tpo -c osm_vendor_ibumad.c  -fPIC -DPIC -o .libs/libosmvendor_la-osm_vendor_ibumad.o
>>> osm_vendor_ibumad.c: In function ‘osm_vendor_open_port’:
>>> osm_vendor_ibumad.c:745:56: error: passing argument 2 of ‘umad_get_ca_portguids’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>>>    if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], portguids,
>>>                                                         ^~~~~~~~~
>>> In file included from ../include/vendor/osm_vendor_ibumad.h:44,
>>>                  from ../include/vendor/osm_vendor.h:65,
>>>                  from ../include/opensm/osm_madw.h:52,
>>>                  from osm_vendor_ibumad.c:66:
>>> /usr/include/infiniband/umad.h:178:56: note: expected ‘__be64 *’ {aka ‘long long unsigned int *’} but argument is of type ‘ib_net64_t *’ {aka ‘long unsigned int *’}
>>>  int umad_get_ca_portguids(const char *ca_name, __be64 *portguids, int max);
>>>                                                 ~~~~~~~~^~~~~~~~~
>>> cc1: all warnings being treated as errors
>>
>> When libibumad was moved into rdma-core, the type of the portguids
>> parameter for the umad_get_ca_portguids API was changed from uint64_t to
>> __be64 and this was thought to be safe because it was thought that these
>> types were the same but that appears not to be the case here ;-(
> 
> They are the same, this is just a somewhat expected warning.
> 
> If you insist on compiling with -Werror then these things have to be
> fixed, otherwise the warning is harmless.
> 
> The proper fix is likely to change ib_net64_t to __be64.

That would move the same issue to when compiling OpenSM with -Werror
with older libibumads (umad.h).

>> The above is fine for libibumads (umad.h) incorporated into rdma-core
>> but won't work with (older) libibumads (umad.h) prior to it's
>> incorporation into rdma-core. This seems to need some conditionalization
>> but I'm not sure what it would/could be conditionalized on as yet.
> 
> Well, you get a harmless warning. Ignore the warning if someone mixes
> old with new.

I think that just ignoring the harmless warning is the easiest way to go.

-- Hal

> 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