Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-empty-init-3.c
blob6a144213b4c94c825741d44fb09de0d4dde03afb
1 /* Test empty initializers diagnosed in C23 mode with -Wc11-c23-compat. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c23 -Wc11-c23-compat" } */
5 struct s { int a; };
6 struct s s = {}; /* { dg-warning "empty initializer" } */
7 int x = {}; /* { dg-warning "empty initializer" } */
8 float y = {}; /* { dg-warning "empty initializer" } */
9 void *p = {}; /* { dg-warning "empty initializer" } */
10 union u { int a; long b; };
11 union u z = {}; /* { dg-warning "empty initializer" } */
12 int aa[2] = {}; /* { dg-warning "empty initializer" } */
14 void
15 f (int a)
17 int vla[a] = {}; /* { dg-warning "empty initializer" } */
18 struct s as = {}; /* { dg-warning "empty initializer" } */
19 int ax = {}; /* { dg-warning "empty initializer" } */
20 float ay = {}; /* { dg-warning "empty initializer" } */
21 void *ap = {}; /* { dg-warning "empty initializer" } */
22 union u az = {}; /* { dg-warning "empty initializer" } */
23 int aaa[2] = {}; /* { dg-warning "empty initializer" } */
24 int t = (int) {}; /* { dg-warning "empty initializer" } */