From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW3kh-0001P3-17 for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW3kc-0001lY-1e for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:38:34 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=59826 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW3kb-0001kx-R4 for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:38:29 -0400 Message-ID: <55E31561.4080008@weilnetz.de> Date: Sun, 30 Aug 2015 16:38:25 +0200 From: Stefan Weil MIME-Version: 1.0 References: <20150830141909.GA13186@var.home> In-Reply-To: <20150830141909.GA13186@var.home> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] baum: Fix build with debugging enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault , qemu-devel@nongnu.org Am 30.08.2015 um 16:19 schrieb Samuel Thibault: > cur and buf are pointers, so the difference can be a long int on 64bit > platforms. > > Signed-off-by: Samuel Thibault > > diff --git a/backends/baum.c b/backends/baum.c > index a69aaff..0fa8025 100644 > --- a/backends/baum.c > +++ b/backends/baum.c > @@ -303,7 +303,7 @@ static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len) > return 0; > cur++; > } > - DPRINTF("Dropped %d bytes!\n", cur - buf); > + DPRINTF("Dropped %ld bytes!\n", (long int) (cur - buf)); Using %td (and no type cast) would be better. Regards Stefan