[dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Maxime Coquelin maxime.coquelin at redhat.com
Mon Aug 19 13:41:19 CEST 2019



On 8/19/19 10:40 AM, David Marchand wrote:
> On Thu, Aug 15, 2019 at 6:16 PM David Christensen
> <drc at linux.vnet.ibm.com> wrote:
>>
>>>> Use of %llx print formatting causes meson build error on Power systems with
>>>> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
>>>>
>>>> +                               (uint64_t)reg_struct.range.start,
>>>> +                               (uint64_t)reg_struct.range.start +
>>>> +                               (uint64_t)reg_struct.range.len - 1);
>>
>> I didn't need them when compiling on Power but it's the only way I could
>> get x86 to build without any warning:
>>
>> cc -Ilib/lib@@rte_vhost at sta -Ilib -I../lib -Ilib/librte_vhost
>> -I../lib/librte_vhost -I. -I../ -Iconfig -I../config
>> -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
>> -I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common
>> -I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86
>> -I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal
>> -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs
>> -Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net
>> -I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf
>> -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring
>> -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter
>> -Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash
>> -I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe
>> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h
>> -Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC
>> -march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ
>> 'lib/lib@@rte_vhost at sta/librte_vhost_vhost_user.c.o' -MF
>> 'lib/lib@@rte_vhost at sta/librte_vhost_vhost_user.c.o.d' -o
>> 'lib/lib@@rte_vhost at sta/librte_vhost_vhost_user.c.o' -c
>> ../lib/librte_vhost/vhost_user.c
>> ../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
>> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
>> argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’
>> [-Wformat=]
>>      RTE_LOG(INFO, VHOST_CONFIG,
>>      ^
>> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
>> argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’
>> [-Wformat=]
>>
>> This system was also RHEL 7.6 with gcc 4.8.5-36
> 
> Ok, I run the same.
> The catch is that I did not have RTE_LIBRTE_VHOST_POSTCOPY enabled in
> my working environment (using make) while meson enables it as long as
> userfaultd.h is present.
> 
> Maxime, Tiwei,
> 
> Can't we use uintXX_t instead of (what looks to me) kernel types __uXX ?
> 
> 

That actually comes from a kernel header (linux/userfaultfd.h), so I
would say no.


More information about the dev mailing list