This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/80454] -Wmissing-braces wrongly warns about universal zero initializer {0}


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]