Received: from eggs.gnu.org ([2001:4830:134:3::10]:49106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4R2q-00083w-R9 for qemu-devel@nongnu.org; Wed, 31 Jul 2013 03:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4R2i-0001Dn-8P for qemu-devel@nongnu.org; Wed, 31 Jul 2013 03:42:04 -0400 Message-ID: <51F8BFC0.1050306@suse.de> Date: Wed, 31 Jul 2013 09:41:52 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1375246847-30624-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1375246847-30624-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for 1.6] hw/core: Fix wrong left shift (build regression) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-trivial , Anthony Liguori , qemu-devel Am 31.07.2013 07:00, schrieb Stefan Weil: > Shifting a long int (32 bit) by 40 bit positions won't work. > Compiler message: >=20 > hw/core/qdev-properties.c: In function =E2=80=98print_size=E2=80=99: > hw/core/qdev-properties.c:1180:5: warning: left shift count >=3D width = of type >=20 > Signed-off-by: Stefan Weil > --- > hw/core/qdev-properties.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Compare rth's patch: http://patchwork.ozlabs.org/patch/263513/ Andreas >=20 > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c > index 8d43a8d..e82ab87 100644 > --- a/hw/core/qdev-properties.c > +++ b/hw/core/qdev-properties.c > @@ -1177,7 +1177,7 @@ static int print_size(DeviceState *dev, Property = *prop, char *dest, size_t len) > int i =3D 0; > uint64_t div; > =20 > - for (div =3D (long int)1 << 40; !(*ptr / div) ; div >>=3D 10) { > + for (div =3D 1ULL << 40; !(*ptr / div); div >>=3D 10) { > i++; > } > return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffixes[= i]); >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg