This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59855] Support sparse-style __attribute__((designated_init)) on structures, requiring designated initializers
- From: "josh at joshtriplett dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Jul 2014 18:08:30 +0000
- Subject: [Bug c/59855] Support sparse-style __attribute__((designated_init)) on structures, requiring designated initializers
- Auto-submitted: auto-generated
- References: <bug-59855-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59855
--- Comment #5 from Josh Triplett <josh at joshtriplett dot org> ---
(In reply to Tom Tromey from comment #4)
> Implemented on trunk.
Thanks!
Please consider including anonymous structs and unions in the test case as
well:
struct S {
int a;
union {
int b;
int c;
};
} __attribute__((designated_init));
static struct S s = {
.a = 0,
.b = 0,
};
union U {
int a;
struct {
int b;
int c;
} __attribute__((designated_init));
};
static union U u = {
.b = 0,
.c = 0,
};
Both of the cases above should produce no warnings; analogous positional
initializers should produce warnings.