Re: [PATCH] kernel/sysctl: Resolve missing-field-initializers warnings
From: Andrew Morton
Date: Tue Oct 21 2014 - 15:07:18 EST
On Sat, 18 Oct 2014 17:39:10 -0700 ebiederm@xxxxxxxxxxxx (Eric W. Biederman) wrote:
> Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx> writes:
>
> > From: Mark Rustad <mark.d.rustad@xxxxxxxxx>
> >
> > Resolve missing-field-initializers warnings in W=2 builds by
> > using designated initialization.
>
> ick. No.
>
> That gcc warning makes no sense. In this case heeding it makes the code
> significantly uglier and significantly more confusing.
>
Yeah, it's not pretty.
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -257,7 +257,7 @@ static struct ctl_table sysctl_base_table[] = {
> > .mode = 0555,
> > .child = dev_table,
> > },
> > - { }
> > + { .procname = NULL }
> > };
We use { } to mean "all zero" in 12 squillion places. Do they all warn
or is there something special about this site?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/