annotate gcc/testsuite/gcc.dg/c99-flex-array-7.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Initialization of a flexible array member with a string constant
kono
parents:
diff changeset
2 must be diagnosed. PR 37481. */
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 struct s { int a; char b[]; };
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct s a = { 0, "" }; /* { dg-error "initialization of a flexible array member" } */
kono
parents:
diff changeset
9 /* { dg-message "near init" "near init" { target *-*-* } .-1 } */
kono
parents:
diff changeset
10 struct s b = { 0, { 0 } }; /* { dg-error "initialization of a flexible array member" } */
kono
parents:
diff changeset
11 /* { dg-message "near init" "near init" { target *-*-* } .-1 } */
kono
parents:
diff changeset
12 struct s c = { 0, { } }; /* { dg-error "ISO C forbids empty initializer braces" } */
kono
parents:
diff changeset
13 struct s d = { .b = "" }; /* { dg-error "initialization of a flexible array member" } */
kono
parents:
diff changeset
14 /* { dg-message "near init" "near init" { target *-*-* } .-1 } */
kono
parents:
diff changeset
15 struct s e = { .b = { 0 } }; /* { dg-error "initialization of a flexible array member" } */
kono
parents:
diff changeset
16 /* { dg-message "near init" "near init" { target *-*-* } .-1 } */
kono
parents:
diff changeset
17 struct s f = { .b = { } }; /* { dg-error "ISO C forbids empty initializer braces" } */