Fix file cache tunables documentation
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstringop-overflow-63.c
blobc98721dd8c771156b0b50f060e8e6de7048df91e
1 /* PR middle-end/92936 - missing warning on a past-the-end store to a PHI
2 Test case derived from gcc/opts-common.c.
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 typedef __SIZE_TYPE__ size_t;
8 char* f (const void*, ...);
10 const char *
11 candidates_list_and_hint (const char *arg, char **str, const char *a[])
13 size_t len = 0;
14 int i;
16 for (i = 0; a[i]; ++i)
17 len += __builtin_strlen (a[i]) + 1;
19 char *p = (char*)__builtin_malloc (len);
20 *str = p;
22 for (i = 0; a[i]; ++i)
24 len = __builtin_strlen (a[i]);
25 __builtin_memcpy (p, a[i], len);
26 p[len] = ' ';
27 p += len + 1;
30 p[-1] = '\0'; // { dg-bogus "\\\[-Wstringop-overflow" }
32 return f (arg, &a);