On 7/23/21 7:38 AM, Petr Viktorin wrote:
(In both C & C++, the size of an `enum` is implementation-defined. That's unlikely to be a problem in practice, but one more point against enum.)


True, but there's always the old trick of sticking in a value that forces it to be at least 32-bit:

typedef enum {
    INVALID = 0,
    RED = 1,
    BLUE = 2,
    GREEN = 3,

    UNUSED = 1073741824
} color_t;


/arry