Re: [kvm-unit-tests PATCH v2 05/10] lib: x86: Use portable format macros for uint32_t

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

 



On 01/09/2020 10.50, Roman Bolshakov wrote:
> Compilation of the files fails on ARCH=i386 with i686-elf gcc because
> they use "%x" or "%d" format specifier that does not match the actual
> size of uint32_t:
> 
> x86/s3.c: In function ‘main’:
> x86/s3.c:53:35: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘u32’ {aka ‘long unsigned int’}
> [-Werror=format=]
>    53 |  printf("PM1a event registers at %x\n", fadt->pm1a_evt_blk);
>       |                                  ~^     ~~~~~~~~~~~~~~~~~~
>       |                                   |         |
>       |                                   |         u32 {aka long unsigned int}
>       |                                   unsigned int
>       |                                  %lx
> 
> Use PRIx32 instead of "x" and PRId32 instead of "d" to take into account
> u32_long case.
> 
> Cc: Alex Bennée <alex.bennee@xxxxxxxxxx>
> Cc: Andrew Jones <drjones@xxxxxxxxxx>
> Cc: Cameron Esfahani <dirty@xxxxxxxxx>
> Cc: Radim Krčmář <rkrcmar@xxxxxxxxxx>

Radim does not work at redhat.com anymore, so please remove that line in
case you respin the patch.

> Signed-off-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx>
> ---
>  lib/pci.c     | 2 +-
>  x86/asyncpf.c | 2 +-
>  x86/msr.c     | 3 ++-
>  x86/s3.c      | 2 +-
>  4 files changed, 5 insertions(+), 4 deletions(-)

Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux