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

            Bug ID: 85259
           Summary: [8 Regression] Missing -Wstringop-overflow= since
                    r256683
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: law at gcc dot gnu.org, msebor at gcc dot gnu.org
  Target Milestone: ---

Since the revision, for:

$ cat /tmp/xx11.c
#include <string.h>

char buf[6];
int main(int argc, char **argv) {
        strcpy(buf,"hello ");
        strcat(buf,"world!");
        return 0;
}

$ gcc -O2 -Wall /tmp/xx11.c -D_FORTIFY_SOURCE=2
[no output]

Before the revision I see:
/usr/include/bits/string_fortified.h:128:10: warning: ‘__builtin___memcpy_chk’
writing 7 bytes into a region of size 6 overflows the destination
[-Wstringop-overflow=]

Reply via email to