]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Walloca-larger-than.c
284601d22ff8d6d3175dde76ee89d4df8248374e
1 /* PR middle-end/82063 - issues with arguments enabled by -Wall
3 { dg-options "-O2 -Walloca-larger-than=0 -Wvla-larger-than=0 -ftrack-macro-expansion=0" } */
5 extern void* alloca (__SIZE_TYPE__
);
11 void test_alloca (void)
13 /* Verify that alloca(0) is diagnosed even if the limit is zero. */
14 T (alloca (0)); /* { dg-warning "argument to .alloca. is zero" } */
15 T (alloca (1)); /* { dg-warning "argument to .alloca. is too large" } */
18 void test_vla (unsigned n
)
20 /* VLAs smaller than 32 bytes are optimized into ordinary arrays. */
24 char a
[n
]; /* { dg-warning "argument to variable-length array " } */