qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] IDE Debug compiler warnings


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] IDE Debug compiler warnings
Date: Fri, 28 Oct 2011 21:47:18 +0100

On 28 October 2011 20:39, John Baboval <address@hidden> wrote:
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -327,7 +327,7 @@ static void ahci_mem_write(void *opaque,
> target_phys_addr_t addr,
>     }
>      if (addr < AHCI_GENERIC_HOST_CONTROL_REGS_MAX_ADDR) {
> -        DPRINTF(-1, "(addr 0x%08X), val 0x%08X\n", (unsigned) addr, val);
> +        DPRINTF(-1, "(addr 0x%08X), val 0x%08lX\n", (unsigned) addr, val);

val is uint64_t so you need to use PRIx64 (otherwise you
get warnings on either 32 bit or 64 bit hosts depending
on whether you use %x or %lx).

> --- a/hw/ide/piix.c
> +++ b/hw/ide/piix.c
> @@ -53,7 +53,7 @@ static uint64_t bmdma_read(void *opaque,
> target_phys_addr_t addr, unsigned size)
>         break;
>     }
>  #ifdef DEBUG_IDE
> -    printf("bmdma: readb 0x%02x : 0x%02x\n", addr, val);
> +    printf("bmdma: readb 0x%02lx : 0x%02x\n", addr, val);

target_phys_addr_t may be a type that %lx isn't correct for
(depending on both the target and host architectures);
you need to cast or use TARGET_FMT_plx here and in the next one.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]