I have the following code:
enum SpeedMode {Slow, Medium Fast};
SpeedMode mode = SpeedMode::Slow;
void foo (void) {
switch (mode) {
case SpeedMode::Slow: // something
case SpeedMode::Fast: // somthingier
//case SpeedMode::Medium: /*missing*/
}
}
I want to have gcc produce an error in this situation to make sure it doesn't get just a warning. Furthermore, I want to make it somewhat inconvenient to just add a default when there really shouldn't be any. Is there a particular attribute or pragma for this?