This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66322] Linus Torvalds: -Wswitch-bool produces dubious warnings, fails to notice really bad things
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 28 May 2015 09:38:27 +0000
- Subject: [Bug c/66322] Linus Torvalds: -Wswitch-bool produces dubious warnings, fails to notice really bad things
- Auto-submitted: auto-generated
- References: <bug-66322-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66322
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I guess we also shouldn't warn on
(1) switch (bool)
{
case true: ...
default: ...
}
(2) switch (bool)
{
case true: ...
}
(3) switch (bool)
{
default:
}
Similarly with s/true/false/.
BTW, I've checked what clang does and the behavior is the same as GCC 5.1.