PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstringop-overflow-3.c
blob6c8cbf3898ebe272cbd7e7136372e72b6b7861e4
1 /* PR tree-optimization/84238 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-require-effective-target alloca } */
6 char a[1];
7 int b;
8 char *strncpy (char *, char *, __SIZE_TYPE__);
9 void
10 c ()
12 char d[b];
13 strncpy (a, &d[3], 3); /* { dg-warning "writing 3 bytes into a region of size 1" } */