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/66322] Linus Torvalds: -Wswitch-bool produces dubious warnings, fails to notice really bad things


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.


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