------- Comment #1 from pinskia at gcc dot gnu dot org 2006-11-09 04:37 ------- http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Structures-unions-enumerations-and-bit_002dfields-implementation.html
You are incorrect in saying enum are compatiable with int by default and incorrect in saying the C standard says that. What it says it is compatiable with an implemenation defined integer type. And we define that as the following: # The integer type compatible with each enumerated type (C90 6.5.2.2, C99 6.7.2.2). Normally, the type is unsigned int if there are no negative values in the enumeration, otherwise int. If -fshort-enums is specified, then if there are negative values it is the first of signed char, short and int that can represent all the values, otherwise it is the first of unsigned char, unsigned short and unsigned int that can represent all the values. On some targets, -fshort-enums is the default; this is determined by the ABI. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29774