I guess nobody else uses enumerators?
[ pedantic ] They are actually called "enumerations". I mention this because object oriented programming includes the concept of "enumerators" which is generally very different from "enumerations". [ / pedantic ]
By default, enumerations in the Arduino world are the same size as int
. In most cases, a single byte is enough storage. To force the compiler's hand, I usually prefer const uint8_t
However, I do like defining bit-field constants using enumerations.
According to Rafael Baptista...http://oroboro.com/short-enum/
...enumerations can be forced to "short enums" by including __attribute__ ((__packed__))
in the definition.