qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 2/2] target-ppc: Cast ssize_t to size_t before printing with %zx
Date: Tue, 23 Dec 2014 23:36:07 +0100	[thread overview]
Message-ID: <5499EE57.4000808@weilnetz.de> (raw)
In-Reply-To: <1419373336-17800-3-git-send-email-peter.maydell@linaro.org>

Am 23.12.2014 um 23:22 schrieb Peter Maydell:
> The mingw32 compiler complains about trying to print variables of type
> ssize_t with the %z format string specifier. Since we're printing it
> as unsigned hex anyway, cast to size_t to silence the warning.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I suspect that this is a compiler bug, but this is the only instance
> in the codebase so I'm prepared to work around it to get to a point
> where we can turn on warnings-as-errors for w32, because some of the
> w32-specific errors really are flagging up issues we need to fix.
> ---
>   hw/ppc/spapr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 08401e0..9aaa800 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1438,7 +1438,7 @@ static void ppc_spapr_init(MachineState *machine)
>       }
>       if (spapr->rtas_size > RTAS_MAX_SIZE) {
>           hw_error("RTAS too big ! 0x%zx bytes (max is 0x%x)\n",
> -                 spapr->rtas_size, RTAS_MAX_SIZE);
> +                 (size_t)spapr->rtas_size, RTAS_MAX_SIZE);
>           exit(1);
>       }
>       g_free(filename);

Which compiler did you use? I get no warning with Debian's 
x86_64-w64-mingw32-gcc 4.6.3 or
native MinGW-w32 compilers.

Stefan

  reply	other threads:[~2014-12-23 22:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 22:22 [Qemu-devel] [PATCH 0/2] target-ppc: Fix clang and w32 warnings Peter Maydell
2014-12-23 22:22 ` [Qemu-devel] [PATCH 1/2] target-ppc: Mark SR() and gen_sync_exception() as !CONFIG_USER_ONLY Peter Maydell
2014-12-23 22:22 ` [Qemu-devel] [PATCH 2/2] target-ppc: Cast ssize_t to size_t before printing with %zx Peter Maydell
2014-12-23 22:36   ` Stefan Weil [this message]
2014-12-23 22:47     ` Peter Maydell
2014-12-24  9:47       ` Stefan Weil
2014-12-23 22:50   ` Eric Blake
2014-12-23 23:09     ` Peter Maydell
2014-12-23 23:25 ` [Qemu-devel] [PATCH 0/2] target-ppc: Fix clang and w32 warnings Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5499EE57.4000808@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).