From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOWfG-0008UQ-2c for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOWf7-0002zx-4U for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:17:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOWf6-0002zg-TB for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:16:53 -0400 Message-ID: <5323478E.1080008@redhat.com> Date: Fri, 14 Mar 2014 19:16:46 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <3096076082478dafe78553ab5cbd8b572904cbc4.1394794127.git.jcody@redhat.com> <20140314153639.GD1985@redhat.com> <20140314155742.GU1346@redhat.com> <53232D9E.2010002@redhat.com> <20140314165109.GV1346@redhat.com> <53233BEB.2090102@redhat.com> <20140314174947.GW1346@redhat.com> In-Reply-To: <20140314174947.GW1346@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: Kevin Wolf , Peter Maydell , Jeff Cody , QEMU Developers , Alexander Graf , Stefan Hajnoczi On 03/14/14 18:49, Richard W.M. Jones wrote: > On Fri, Mar 14, 2014 at 06:27:07PM +0100, Laszlo Ersek wrote: >> *Why* someone would want to use an integer constant with type >> "uint_least64_t" is a separate matter. One example follows -- assume all >> of the below: >> - suppose you write portable C99 source code, >> - hence you can't take uint64_t for granted, >> - you want a constant that's otherwise small enough to be represented as >> "int", >> - but you want that constant to trigger the "usual arithmetic >> conversions" (see 6.3.1.8) to evaluate expressions that the constant >> participates in in at least 64 bits, >> - you want the narrowest type that allows you to do this. > > - You want the code to self-document its intentions. I do. > I don't think ULL does that because it requires people to know that > ULL is at least 64 bits. Oh. I see what you mean. This never crossed my mind (= people missing the fact that unsigned long long can represent at least up to 2^64-1). Laszlo