From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW3wJ-0004bm-Qx for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW3wF-0006jQ-Lb for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:50:35 -0400 Received: from domu-toccata.ens-lyon.fr ([140.77.166.138]:34813 helo=sonata.ens-lyon.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW3wF-0006jE-94 for qemu-devel@nongnu.org; Sun, 30 Aug 2015 10:50:31 -0400 Date: Sun, 30 Aug 2015 16:50:29 +0200 From: Samuel Thibault Message-ID: <20150830145029.GC3238@var.home> References: <20150830141909.GA13186@var.home> <55E31561.4080008@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <55E31561.4080008@weilnetz.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] baum: Fix build with debugging enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org Stefan Weil, le Sun 30 Aug 2015 16:38:25 +0200, a =E9crit : > Am 30.08.2015 um 16:19 schrieb Samuel Thibault: > > cur and buf are pointers, so the difference can be a long int on 64bi= t > > 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)); >=20 > Using %td (and no type cast) would be better. Ah, do we assume that %td is supported by libc? Samuel