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

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 26 10:46:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-26 10:46:11 UTC ---
(In reply to comment #6)
> On Wed, 25 Apr 2012, manu at gcc dot gnu.org wrote:
> 
> > It seems to me you are right. However, I cannot see how to check for ={0} at
> > the point of the warning.
> > 
> > Joseph, any ideas? This part of the C FE is ancient.
> 
> In general I think Jakub is more expert on the code for handling 
> initializers than I am.

OK, but do you agree that the warning should be silenced always for ={0}?

Jakub, do you have any pointers for this? At the point of the warning "value"
is null, so I am not sure how to check for ={0}. There is a boolean zeroinit
later, 

        bool constructor_zeroinit =
         (VEC_length (constructor_elt, constructor_elements) == 1
          && integer_zerop
              (VEC_index (constructor_elt, constructor_elements, 0)->value));

but this vector is not initialized in this case.



More information about the Gcc-bugs mailing list