public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98097] New: Missing warning about strcmp (char[4], "BARZ")
@ 2020-12-02 14:07 rguenth at gcc dot gnu.org
  2020-12-02 14:07 ` [Bug tree-optimization/98097] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-02 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98097
           Summary: Missing warning about strcmp (char[4], "BARZ")
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

#include <string.h>

struct info {
   char type[4];
   unsigned int status;
};

int foo (struct info *i)
{
  return strcmp (i->type, "ECKD") == 0;
}

Does not warn with -Wstring-compare, the variant with i passed by value does.

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

end of thread, other threads:[~2021-01-08  0:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 14:07 [Bug tree-optimization/98097] New: Missing warning about strcmp (char[4], "BARZ") rguenth at gcc dot gnu.org
2020-12-02 14:07 ` [Bug tree-optimization/98097] " rguenth at gcc dot gnu.org
2020-12-02 15:48 ` msebor at gcc dot gnu.org
2020-12-02 16:06 ` jakub at gcc dot gnu.org
2021-01-08  0:54 ` msebor 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).