This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/61864] Feature Request, -Wcovered-switch-default to identify "dead" default branch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]