Debian Codegraph @

gcc/testsuite/gcc.dg/Wstringop-overflow-3.c

raw
1 /* PR tree-optimization/84238 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4
5 char a[1];
6 int b;
7 char *strncpy (char *, char *, __SIZE_TYPE__);
8 void
9 c ()
10 {
11 char d[b];
12 strncpy (a, &d[3], 3); /* { dg-warning "writing 3 bytes into a region of size 1" } */
13 }