What is your procedure when switching over an enum where every enumeration is covered by a case? Ideally you\'d like the code to be future proof, how do you do that?
<
Because it may help to know what the unexpected value of the enum was, write your own BADENUM(Enum) macro, along the lines of:
#define _STRIZE(x) _VAL(x)
#define _VAL(x) #x
extern void __attribute__ ((noreturn)) AssertFail(const char *Message);
#define ASSERT(Test) ((Test) ? (void)0 : AssertFail(__FILE__ ":" _STRIZE(__LINE__) " " #Test))
extern void __attribute__ ((noreturn)) BadEnum(const char *Message, const long unsigned Enum);
#define BADENUM(Enum) BadEnum(__FILE__ ":" _STRIZE(__LINE__), (u32)Enum))