public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces
Date: Wed, 20 Mar 2019 14:22:09 +0200	[thread overview]
Message-ID: <20190320122209.GT4038@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <87tvfxeoez.fsf@intel.com>

On Wed, Mar 20, 2019 at 02:11:16PM +0200, Jani Nikula wrote:
> On Wed, 20 Mar 2019, "Ser, Simon" <simon.ser@intel.com> 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.
> 
> Right, it's also okay in ISO C++11.
> 
> > Does IGT use un-standardized extensions?
> 
> I'm pretty sure it does, but I'll defer decisions about this to the IGT
> maintainers.


We use -std=gnu11.

It's not as an explicit flag anywhere, making it hard to find. It's in
toplevel meson.build, the project() call, default_options:
'c_std=gnu11'

A quick look in autotools reveals that we don't set the std on it at
all. Oh well.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-20 12:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  8:52 [igt-dev] [PATCH i-g-t] meson: add -Wno-missing-braces Ser, Simon
2019-03-20  9:38 ` Jani Nikula
2019-03-20 10:53   ` Ser, Simon
2019-03-20 12:11     ` Jani Nikula
2019-03-20 12:22       ` Petri Latvala [this message]
2019-03-21  7:25         ` Ser, Simon
2019-03-21  7:21       ` Ser, Simon
2019-03-20 13:52     ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190320122209.GT4038@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox