libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstringop-overflow-19.c
blobcf866b3f1ee694f7106832fcd24747ab703e1e44
1 /* PR middle-end/92014 - bogus warning: writing 8 bytes into a region
2 of size 1 in timezone/zic.c
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 struct
8 char *s1, *s2;
9 char c;
10 } z;
13 void f (char **a, int i, int j)
15 char * cp = __builtin_strchr (a[i], '%');
17 if (cp && *++cp != 's')
18 return;
20 z.s1 = __builtin_strdup (a[i]);
21 if (!z.s1) __builtin_abort ();
23 z.s2 = __builtin_strdup (a[j]);
24 if (!z.s2) __builtin_abort ();
26 z.c = cp ? *cp : '\0'; // { dg-bogus "\\\[-Wstringop-overflow" }