PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloca-7.c
blob11c38c18fd6666f55ca3b03bccc2d4d556b59234
1 /* { dg-do compile } */
2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-Walloca -O0" } */
5 extern void f(void *);
7 void foo(void)
9 // Test that strict -Walloca works even without optimization.
10 f (__builtin_alloca(500)); // { dg-warning "use of 'alloca'" }
13 void bar(void)
15 // Test that we warn on alloca() calls, not just __builtin_alloca calls.
16 extern void *alloca(__SIZE_TYPE__);
17 f (alloca (123)); // { dg-warning "use of 'alloca'" }