This seems like a very clunky way to implement this, no?

Normally we'd do something like

#define NUM_ILLEGAL_FLAGS 4
const int illegal_flags[NUM_ILLEGAL_FLAGS] = {..., ..., ..., ...};

then the function would be medit_illegal_flag(int fl);


Is your implementation better, and if so could you explain why?