1 /* Tests for the "Initializer entry defined twice" warning. */
3 /* Initializing a struct field twice should trigger the warning. */
9 static struct normal struct_error
= {
14 /* Initializing two different fields of a union should trigger the warning. */
24 static struct has_union union_error
= {
31 /* Empty structures can make two fields have the same offset in a struct.
32 * Initializing both should not trigger the warning. */
40 static struct same_offset not_an_error
= {
46 * _Bools generally take a whole byte, so ensure that we can initialize
47 * them without spewing a warning.
49 static _Bool boolarray
[3] = {
55 * check-name: Initializer entry defined twice
58 initializer-entry-defined-twice.c:10:10: warning: Initializer entry defined twice
59 initializer-entry-defined-twice.c:11:10: also defined here
60 initializer-entry-defined-twice.c:26:18: warning: Initializer entry defined twice
61 initializer-entry-defined-twice.c:27:18: also defined here