This is the mail archive of the gcc@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]

-Wmissing-field-initializers relaxation request


While trying to compile coreutils with -Wextra,
I noticed many warnings due to automatic variables
initialized with { 0, }.

As I understand it, since C90 the above will initialize
[all members of] the type to that used in static scope.

I.E. the following is valid:

mbstate_t m = { 0, };
int i = { 0, };
struct { int a; int b; } s = { 0, };

It would be great I think if gcc would relax this
warning in the specific case where { 0, } is specified.
I.E. with a trailing ',' as that would be clear indication
that one wants to init all elements to 0, and that
we haven't just forgotten some members.

thanks,
PÃdraig.


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