From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3Y3t-0004W9-NV for qemu-devel@nongnu.org; Tue, 23 Dec 2014 17:36:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3Y3n-0005AX-S4 for qemu-devel@nongnu.org; Tue, 23 Dec 2014 17:36:17 -0500 Message-ID: <5499EE57.4000808@weilnetz.de> Date: Tue, 23 Dec 2014 23:36:07 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1419373336-17800-1-git-send-email-peter.maydell@linaro.org> <1419373336-17800-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1419373336-17800-3-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] target-ppc: Cast ssize_t to size_t before printing with %zx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf 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 > --- > 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