Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces

Ville Syrjälä
2019-03-20T13:52:08Z

On Wed, Mar 20, 2019 at 10:53:05AM +0000, Ser, Simon wrote:
> On Wed, 2019-03-20 at 11:38 +0200, Jani Nikula wrote:
> > On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> wrote:
> > > Enabling -Werror=missing-braces results in this error with Clang:
> > >
> > > ../tests/kms_vrr.c:203:20: error: suggest braces around
> > > initialization of subobject [-Werror,-Wmissing-braces]
> > > drmVBlank vbl = { 0 };
> > > ^
> > > {}
> > >
> > > I don't believe there is any value in keeping this, so let's just
> > > disable it.
> >
> > I fail to come up with examples right now, but I think there are
> > legitimate cases for the warning.
> >
> > Arguably the above initializer should be written as simply {} instead
> > of
> > having the 0 value for initializing the first member which happens to
> > be
> > a substruct.
>
> Unfortunately using {} is a GNU extension, and ISO C forbids empty
> initializer lists.
>
> Does IGT use un-standardized extensions?

$ git grep '=[ ]*{[ ]*}' | wc -l
195

--
Ville Syrjälä
Intel