Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-fordecl-4.c
blob09ae3b4754959a6e1e16f5e49fef4764167a334e
1 /* Test for C99 declarations in for loops. Test constraints are diagnosed with
2 -Wc11-c23-compat for C23: struct and union tags can't be declared there
3 (affirmed in response to DR#277). Based on c99-fordecl-3.c. */
4 /* { dg-do compile } */
5 /* { dg-options "-std=c23 -pedantic-errors -Wc11-c23-compat" } */
7 void
8 foo (void)
10 for (struct s { int p; } *p = 0; ;) /* { dg-warning "'struct s' declared in 'for' loop initial declaration" } */
12 for (union u { int p; } *p = 0; ;) /* { dg-warning "'union u' declared in 'for' loop initial declaration" } */