In the C89 / 90 version of the C language, all aggregated initializers should consist only of constants. In C terminology, a constant of type int is a literal value, for example 10 , 20u , 0x1 , etc. Enum members are also constants. Variables of type const int are not constants in C. You cannot use the variable const int in an aggregate initializer. (For this reason, in C, when you need to declare a named constant, you must use either #define or enum , but not a const qualifier.)
In C99, this requirement for aggregate initializers has been relaxed. Now you can use non-constants in aggregate initializers of local objects. However, for static objects (as in your example), the requirement still persists. So, even in C99 you have to either use
or use the enum name constant as indicated by @R ..
source share