From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:56353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk2vX-0000wr-F1 for qemu-devel@nongnu.org; Thu, 17 Jan 2019 03:21:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk2vQ-0004Ki-M5 for qemu-devel@nongnu.org; Thu, 17 Jan 2019 03:21:23 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:38931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gk2vL-0004Db-5n for qemu-devel@nongnu.org; Thu, 17 Jan 2019 03:21:15 -0500 Received: by mail-wr1-x444.google.com with SMTP id t27so9929622wra.6 for ; Thu, 17 Jan 2019 00:21:13 -0800 (PST) References: <20190116121350.23863-1-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Thu, 17 Jan 2019 08:21:10 +0000 Message-ID: <874la7zocp.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Xen-devel] [PATCH] hw/block/xen: use proper format string for printing sectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Cooper Cc: peter.maydell@linaro.org, Kevin Wolf , Stefano Stabellini , "open list:Block layer core" , qemu-devel@nongnu.org, Max Reitz , Paul Durrant , Anthony Perard , "open list:X86" Andrew Cooper writes: > On 16/01/2019 12:13, Alex Benn=C3=A9e wrote: >> The %lu format string is different depending on the host architecture >> which causes builds like the debian-armhf-cross build to fail. Use the >> correct PRi64 format string. >> >> Signed-off-by: Alex Benn=C3=A9e >> --- >> hw/block/xen-block.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c >> index be28b63442..a636487b3e 100644 >> --- a/hw/block/xen-block.c >> +++ b/hw/block/xen-block.c >> @@ -215,7 +215,7 @@ static void xen_block_realize(XenDevice *xendev, Err= or **errp) >> >> xen_device_backend_printf(xendev, "sector-size", "%u", >> conf->logical_block_size); >> - xen_device_backend_printf(xendev, "sectors", "%lu", >> + xen_device_backend_printf(xendev, "sectors", "%"PRIi64, > > PRIu64. > > You've changed the signed-ness of what gets printed. I was deliberate as: int64_t blk_getlength(BlockBackend *blk); although I have to admit a signed block length doesn't make much sense to me. At least it isn't going to overflow and will show-up if the block length is ever negative. > > ~Andrew -- Alex Benn=C3=A9e