Why do MC-3020 enumerations map to #defines?
Enumeration support in ANSI C is very weak. Name spacing is absent. Consider enum rock { red = 1 }; enum stone { red = 2 }; … material_color = red; Since enum is not scoped by a C++(ish) class, and C has no namespacing, there is no way for a C compiler to distinguish which “red” to assign to material_color. Note that these declarations may live in separate include files. Thus, MC-3020 uses “long winded” namespacing of #define to avoid the C language weakness. Another weakness lies in the lack of control over the storage allocated to variables declared to be of enumerated type. In resource constrained environments (say an 8-bit micro), we would like our enums to take up something less than an integer of storage.