Structures unions enumerations and bit-fields implementation (Using the GNU Compiler Collection (GCC)) (original) (raw)

The integer type compatible with each enumerated type (C90 6.5.2.2, C99 and C11 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 intthat can represent all the values, otherwise it is the first ofunsigned char, unsigned short and unsigned intthat can represent all the values.

On some targets, -fshort-enums is the default; this is determined by the ABI.