From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOXId-0003tb-SO for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:57:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOXIX-0000nQ-Tw for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:57:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOXIX-0000nJ-KH for qemu-devel@nongnu.org; Fri, 14 Mar 2014 14:57:37 -0400 Message-ID: <5323511A.6040501@redhat.com> Date: Fri, 14 Mar 2014 19:57:30 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <3096076082478dafe78553ab5cbd8b572904cbc4.1394794127.git.jcody@redhat.com> <20140314153639.GD1985@redhat.com> <53232B90.5060408@redhat.com> <53232FD4.1020605@redhat.com> <53233F6C.4030502@redhat.com> <53234F39.6060901@redhat.com> In-Reply-To: <53234F39.6060901@redhat.com> Content-Type: text/plain; charset=UTF-8 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: Peter Maydell Cc: Kevin Wolf , QEMU Developers , Jeff Cody , Alexander Graf , "Richard W.M. Jones" , Stefan Hajnoczi On 03/14/14 19:49, Laszlo Ersek wrote: > One good example is for 6.4.4.1 "Integer constants": > > QUIET CHANGE IN C99 > > Unsuffixed integer constants may have different types in C99 than > in C89. Such constants greater than LONG_MAX are of type unsigned > long in C89, but are of type long long in C99 (if long long has > more range than long). > > I have no clue what gnu89 does. x.c: #include int main(void) { fprintf(stdout, "%u\n", (unsigned)sizeof 2147483648); return 0; } The following script: for I in c89 gnu89 c99 gnu99; do echo "==== $I ====" gcc -m32 -o x -std=$I x.c ./x done outputs: ==== c89 ==== x.c: In function 'main': x.c:6:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] fprintf(stdout, "%u\n", (unsigned)sizeof 2147483648); ^ 4 ==== gnu89 ==== x.c: In function 'main': x.c:6:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] fprintf(stdout, "%u\n", (unsigned)sizeof 2147483648); ^ 4 ==== c99 ==== 8 ==== gnu99 ==== 8 Laszlo