Re:Useful GCC warning options not enabled by -Wall -Wextra
by Sean1708 on Thursday October 05, 2017 @08:09AM
(#15408450)
Really? I've literally never written (or at least I don't ever remember writing) a case statement without either specifying every possible value or adding a meaningful default case.
There are exceptions to this "some cases are no-ops" thing. But I think it's the minority of switches I've seen.
From that perspective it does seem like the coding police angle. It's reminiscent of certain things in Java, like making a bunch of implicit conversions into errors, or C#, which forbids implicit fall-through on a switch. Those too are for safety and maintainability. They also make a lot of constructs more ugly. My question is: is it worth it? In this case (unintended pun) I don't think so.