Enumeration declaration variables are non-standard (they violate section C99 6.7.2.3 Β§ 3), and gcc also warns if you add the -pedantic flag (which should be used when writing portable code).
The reason for this is that implementations are free to choose an integer type other than int to use for representing an enumeration (see section 6.99.2.2 Β§99). However, for this, the compiler must see all the values ββthat it must represent before choosing the appropriate type.
source share