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 <stdio.h> 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