This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61864] Feature Request, -Wcovered-switch-default to identify "dead" default branch
- From: "egall at gwmail dot gwu.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Dec 2014 02:26:21 +0000
- Subject: [Bug c/61864] Feature Request, -Wcovered-switch-default to identify "dead" default branch
- Auto-submitted: auto-generated
- References: <bug-61864-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61864
Eric Gallager <egall at gwmail dot gwu.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egall at gwmail dot gwu.edu
--- Comment #2 from Eric Gallager <egall at gwmail dot gwu.edu> ---
this(In reply to Chengnian Sun from comment #0)
> Currently, GCC supports -Wswitch and -Wswitch-enum.
It also supports "-Wswitch-default", which seems to be the exact opposite of
clang's "-Wcovered-switch-default". Personally I think gcc's "-Wswitch-default"
is the better one to listen to; having a default case is a good back-up even if
it will never actually be reached. Here is a link to a post that explains it
better than I could: http://programmers.stackexchange.com/a/242896/161051