This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wmissing-field-initializers relaxation request
- From: "Gabriel Dos Reis" <gdr at integrable-solutions dot net>
- To: "Pádraig Brady" <P at draigbrady dot com>
- Cc: gcc at gnu dot org, "Jim Meyering" <jim at meyering dot net>, kst at cts dot com
- Date: Sun, 6 Jul 2008 16:48:59 -0500
- Subject: Re: -Wmissing-field-initializers relaxation request
- References: <486E499B.2000102@draigBrady.com>
On Fri, Jul 4, 2008 at 11:02 AM, Pádraig Brady <P@draigbrady.com> wrote:
> 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.
This makes sense. Please fill a bugzilla PR so that
it is not lost.