http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652
Alexander Kornienko <alexfh at google dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexfh at google dot com --- Comment #13 from Alexander Kornienko <alexfh at google dot com> 2012-09-17 22:00:49 UTC --- (In reply to comment #12) > However, I think it's important to note that they implement the very noisy > behavior of warning for all implicit fall-through. We could make our warning > much more useful by being silent for empty case statements, FYI, clang's warning does exactly this, i.e. it doesn't (and never did) warn on empty case labels. There's also a way to silence this warning in cases where fallthrough is intended: [[clang::fallthrough]]; construct, which uses custom C++11 statement attribute clang::fallthrough. There's a doc here: http://clang.llvm.org/docs/LanguageExtensions.html#clang__fallthrough In an ideal world, it would be great if GCC had a compatible implementation using C++11 attributes (except for a namespace of the attribute), or for example, using a built-in function. So that it was possible to have the same syntax in source code, at least using a macro. Command-line flags compatibility would also be nice. Or if you have any reasonable suggestions on how this diagnostic can be made better, I'll be glad to discuss this. > and in light of > other warnings starting with -Wswitch, I would recommend we name the warning > -Wswitch-fall-through or something similar. If we want to have an additional > warning that warns for all fall-through, as clang does, we could also add > -Wswitch-empty-fall-through.