Jordan said:
What if there are more than INT_MAX+1 items in the enumeration? Is an
implementation required to reject these, or may it choose long as the
integer type? Or is there undefined behavior?
No, an implementation is not required to reject a declaration with
more than INT_MAX+1 enumeration constants. If the number of declared
enumeration constants exceeds the translator limit, a diagnostic
/should/ be issued (sorry, no C&V).
An implementation must support at least 1023 enumeration constants
(items) for a single enumeration. It may support more. Because there
may be separate enumeration constants with the same value and
enumeration constants can have assigned values, the number of
enumeration constants in an enumeration type is independent of the
range of values.
Although enumeration constants have type int, a specific enumeration
type may have a smaller range of values, be stored in a smaller int
type, and have a lesser rank. Standard C only supports enumeration
values within the range for type int. Attempting to specify an
enumeration constant with a value outside the range of an int violates
a constraint and requires a diagnostic. A conforming implementation
could still support larger values and provide sufficient storage for
the declared range, but it must still issue the diagnostic (in
conforming mode).