[PATCH 1/3] vhost: fix build for powerpc

David Christensen drc at linux.vnet.ibm.com
Tue Sep 12 20:30:00 CEST 2023



On 9/1/23 7:59 AM, Bruce Richardson wrote:
> +PPC maintainer
> 
> On Thu, Aug 31, 2023 at 01:10:56PM +0100, Bruce Richardson wrote:
>> When building on Ubuntu using the packaged powerpc compiler[1], a
>> warning is issued about the print format of the __u64 values.
>>
>> ../../lib/vhost/vduse.c: In function ‘vduse_vring_setup’:
>> ../../lib/vhost/vhost.h:676:17: error: format ‘%llx’ expects argument of
>> type ‘long long unsigned int’, but argument 5 has type ‘__u64’ {aka
>> ‘long unsigned int’} [-Werror=format=]
>>    676 |                 "VHOST_CONFIG: (%s) " fmt, prefix, ##args)
>>        |                 ^~~~~~~~~~~~~~~~~~~~~
>>
>> Changing the format specifier to %lx, or to use PRIx64 breaks other
>> builds, so the safest solution is to explicitly typecast the printed
>> values to match the format string.
>>
>> [1] powerpc64le-linux-gnu-gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0
>>
>> Fixes: a9120db8b98b ("vhost: add VDUSE device startup")
>> Cc: maxime.coquelin at redhat.com
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
>> ---

Tested-by: David Christensen <drc at linux.vnet.ibm.com>


More information about the dev mailing list