lkml.org 
[lkml]   [2014]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/sysctl: Resolve missing-field-initializers warnings
On Sat, 18 Oct 2014 17:39:10 -0700 ebiederm@xmission.com (Eric W. Biederman) wrote:

> Jeff Kirsher <jeffrey.t.kirsher@intel.com> writes:
>
> > From: Mark Rustad <mark.d.rustad@intel.com>
> >
> > 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?



\
 
 \ /
  Last update: 2014-10-21 21:41    [W:0.067 / U:5.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site