comparison gcc/testsuite/gcc.dg/Wdesignated-init-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* PR c/59855 */
2 /* { dg-do compile } */
3 /* { dg-options "-std=gnu11" } */
4
5 struct S {
6 int a;
7 union {
8 int b;
9 int c;
10 };
11 } __attribute__((designated_init));
12
13 struct S s1 = { .a = 0, .b = 0 };
14 struct S s2 = { 0, 0 }; /* { dg-warning "(positional|near initialization)" } */
15 struct S s3 = { .a = 5, 0 }; /* { dg-warning "(positional|near initialization)" } */