public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/103983] New: -Wswitch-bool seems to do nothing ?
@ 2022-01-11 20:39 dcb314 at hotmail dot com
  2022-01-11 21:00 ` [Bug c/103983] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dcb314 at hotmail dot com @ 2022-01-11 20:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103983

            Bug ID: 103983
           Summary: -Wswitch-bool seems to do nothing ?
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

clang has a warning -Wswitch-bool. There are three cases of
it in Fedora rawhide. 

However, gcc doesn't say anything. See this code:

void g( int);

void f( bool b)
{
        switch (b)
        {
        case false:
                g( 1);
                break;
        case true:
                g( 2);
                break;
        }       
}

$ /home/dcb/gcc/results/bin/gcc -c -O2 -Wall -Wextra -Wswitch-bool -pedantic
jan11b.cc
$ clang++ -g -O2 -Wall jan11b.cc
jan11b.cc:9:2: warning: switch condition has boolean value [-Wswitch-bool]
        switch (b)
        ^       ~
1 warning generated.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/103983] -Wswitch-bool seems to do nothing ?
  2022-01-11 20:39 [Bug c/103983] New: -Wswitch-bool seems to do nothing ? dcb314 at hotmail dot com
@ 2022-01-11 21:00 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-11 21:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103983

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The warning was tuned back on purpose because of a request from Linus. This is
a dup of bug 66322 which was that request.

*** This bug has been marked as a duplicate of bug 66322 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-11 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 20:39 [Bug c/103983] New: -Wswitch-bool seems to do nothing ? dcb314 at hotmail dot com
2022-01-11 21:00 ` [Bug c/103983] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).