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.