C99 6.7.2.2 states: The expression that defines the value of an enumeration constant shall be an integer constant expression that has a value representable as an int. Obviously, gcc has an extension that any integral value can be used, and -pedantic can detect that this extension was utilized: $ cat foo.c enum { a = 0x100000001LL }; int main(void) { return a; } $ gcc -Wall -Wextra -std=c99 -fdiagnostics-show-option foo.c -o foo $ gcc -Wall -Wextra -std=c99 -pedantic -fdiagnostics-show-option foo.c -o foo foo.c:1: warning: ISO C restricts enumerator values to range of ‘int’ [-pedantic] $ ./foo; echo $? 1 However, -pedantic is a rather heavy hammer; I would love to have a dedicated -W option, independent of -pedantic, for detecting just the issue of using an integer constant outside the range of int, to be sure that I don't fall foul of something like failure to compiler, or worse behavior like silent enum truncation, on other compilers that don't implement the same extension as gcc.
The compiler now says t.c:1:12: warning: ISO C restricts enumerator values to range of ‘int’ [-Wpedantic] enum { a = 0x100000001LL }; ^ t.c: In function ‘main’: t.c:2:25: warning: overflow in implicit constant conversion [-Woverflow] int main(void) { return a; } ^ So I suppose we can close this as fixed now. Please reopen if you want something else.