public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104948] New: When '&&' present in a comparison, a warning should be generated
@ 2022-03-16  8:42 coenraad at wish dot org.za
  2022-03-16  8:44 ` [Bug c/104948] " coenraad at wish dot org.za
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: coenraad at wish dot org.za @ 2022-03-16  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104948
           Summary: When '&&' present in a comparison, a warning should be
                    generated
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: coenraad at wish dot org.za
  Target Milestone: ---

The sheer number of issues reported here that wrongly use '&&' as a logical
AND, warrants that this warning is direly necessary.

Even worse, the presence of '&&' in an evaluation, causes that branch to be
optimized out, completely, no matter what optimization level is used.

The reason for so many people using '&&' as logical AND, is because that is
what it is in almost every other language in widespread use.

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

end of thread, other threads:[~2022-03-17 10:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  8:42 [Bug c/104948] New: When '&&' present in a comparison, a warning should be generated coenraad at wish dot org.za
2022-03-16  8:44 ` [Bug c/104948] " coenraad at wish dot org.za
2022-03-16  8:51 ` pinskia at gcc dot gnu.org
2022-03-16  9:07 ` coenraad at wish dot org.za
2022-03-16  9:10 ` pinskia at gcc dot gnu.org
2022-03-16  9:10 ` pinskia at gcc dot gnu.org
2022-03-16  9:13 ` rguenth at gcc dot gnu.org
2022-03-16  9:33 ` redi at gcc dot gnu.org
2022-03-16 11:20 ` coenraad at wish dot org.za
2022-03-16 12:34 ` redi at gcc dot gnu.org
2022-03-16 12:40 ` jakub at gcc dot gnu.org
2022-03-16 12:56 ` schwab@linux-m68k.org
2022-03-16 13:04 ` redi at gcc dot gnu.org
2022-03-17  9:03 ` coenraad at wish dot org.za
2022-03-17 10:43 ` [Bug c/104948] When '&&' has non bool parameters, a better " redi 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).