This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80454] -Wmissing-braces wrongly warns about universal zero initializer {0}
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Aug 2017 09:41:50 +0000
- Subject: [Bug c/80454] -Wmissing-braces wrongly warns about universal zero initializer {0}
- Auto-submitted: auto-generated
- References: <bug-80454-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80454
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Is this really a bug?
In the second case we have a union in two nested structs, in the first case
just two nested structs. clang also warns:
w.c:3:60: warning: suggest braces around initialization of subobject
[-Wmissing-braces]
struct { struct { union_t a; long b; } x; int y; } u = { { 0 }, 1 };
^
{}
But yes, the fix-it hints looks strange.