4 ms·
This option is also really annoying when you have switches over really large enum types, such as key codes, where it is usually legitimate to have a default cas
by nhaehnle 12y ago
This option is also really annoying when you have switches over really large enum types, such as key codes, where it is usually legitimate to have a default case.
I guess even more annotations are needed ;)
- dllthomas 12y agoHeh, doubtless. If you have a switch statement where adding a case to the enum doesn't mean you need to consider whether to add it to that switch, it sounds like an appropriate place to use pragmas to disable the warning for the one switch (http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html). If you do need to consider that switch, then I'd say you should still suck it up and list every case (though possibly collapsing similar groups of cases into a single macro... "#define NUMERIC_KEYS case KEY_KP0: case KEY_KP1"...).