Debian Codegraph @

gcc/testsuite/gcc.dg/Wmissing-field-initializers-5.c

raw
1 /* PR c/82283 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wmissing-field-initializers" } */
4
5 struct foo {
6 const char *a1;
7 const char * const *a2;
8 void *a3;
9 void *a4;
10 };
11
12 const char *aux[] = { "y", 0 };
13
14 struct foo a = {
15 .a1 = "x",
16 .a2 = (const char * const []){ "y", 0 },
17 }; /* { dg-bogus "missing initializer" } */
18
19 struct foo b = {
20 .a2 = (const char * const []){ "y", 0 },
21 .a1 = "x",
22 };