https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30020
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-05-30 CC| |manu at gcc dot gnu.org Summary|missing limited range |improve diagnostics for |warning for a switch |limited range warning for a |statement |switch statement Ever confirmed|0 |1 --- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- GCC now warns by default for this, but the location sucks. test.c: In function ‘foo’: test.c:3:3: warning: case label value is less than minimum value for type switch (c) { case -1: return -1; }; ^ It would be nice if it said which type. Clang says: test.c:3:21: warning: overflow converting case value to switch condition type (-1 to 255) [-Wswitch] switch (c) { case -1: return -1; }; ^