From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] configure.ac: disable annoying warning -Wmissing-field-initializers
Date: Fri, 22 Jan 2016 21:33:14 +0200 [thread overview]
Message-ID: <20160122193314.GR23290@intel.com> (raw)
In-Reply-To: <CACvgo51Wr2RmPF5+KVuAc1DG8DUnGMUGNbQ0WdckYdFX2UCBAQ@mail.gmail.com>
On Fri, Jan 22, 2016 at 07:21:31PM +0000, Emil Velikov wrote:
> On 22 January 2016 at 18:49, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Fri, Jan 22, 2016 at 05:59:30PM +0000, Emil Velikov wrote:
>
> >> Also let's not forget about
> >>
> >> a.c:17:20: warning: ISO C forbids empty initializer braces [-Wpedantic]
> >> struct foo f = {};
> >> ^
> >
> > I long ago decided that -pedantic is stupid, hence I don't use it.
> >
> Only tried pedantic as I couldn't find any references to "= {}" in the
> C spec. I'm not even remotely suggesting that we use it.
>
> > My gcc (4.9.3 something) seems to allow the {0} but with a struct within
> > a struct it angers -Wmissing-braces, although my reading of the spec
> The -Wmissing-braces fix might get backported for 4.8 and 4.9 [1]
>
> > suggests that it's pretty well defined how this sort of thing should
> > behave. I was expecting some kind of 'implicit pointer from integer'
> > warning when the thing it would initialize is a pointer, but didn't get
> > one. Not sure why.
> >
> > And {} of course makes -Wmissing-field-initializers upset. I can't see
> > anything in the spec to relly forbid this form, except that the syntax
> > maybe doesn't allow for an empty initializer-list.
> >
> > About the only "useful" thing I learned from the spec is that 0 is an
> > octal constant :) Makes some sense but it never occured to me before.
> >
> > So I guess all I can say is that gcc is stupid, and it should just stfu
> > and let both '= {}' and '= {0}' through without whining about it.
> >
> Luckily with the 5 series things are shaping up :-)
>
> Thanks for digging it up.
> -Emil
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
Hmm. So yet another C vs. C++ difference. I guess everyone has given up
on the supposed ability of C++ to include C code.
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-01-22 19:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 21:14 [PATCH] configure.ac: disable annoying warning -Wmissing-field-initializers Marek Olšák
2016-01-15 11:12 ` Emil Velikov
2016-01-15 15:24 ` Marek Olšák
2016-01-16 19:46 ` David Herrmann
2016-01-18 14:45 ` Emil Velikov
2016-01-18 15:43 ` Marek Olšák
2016-01-18 15:51 ` Jani Nikula
2016-01-18 16:05 ` Emil Velikov
2016-01-18 22:53 ` Marek Olšák
2016-01-21 10:51 ` Emil Velikov
2016-01-21 12:08 ` Marek Olšák
2016-01-21 13:09 ` Emil Velikov
2016-01-21 16:58 ` Marek Olšák
2016-01-22 17:13 ` Emil Velikov
2016-01-22 17:18 ` Marek Olšák
2016-01-22 17:29 ` Ilia Mirkin
2016-01-22 17:40 ` Emil Velikov
2016-01-22 17:47 ` Ville Syrjälä
2016-01-22 17:48 ` Ilia Mirkin
2016-01-22 19:18 ` Jan Vesely
2016-01-22 17:50 ` Emil Velikov
2016-01-22 17:59 ` Emil Velikov
2016-01-22 18:49 ` Ville Syrjälä
2016-01-22 19:21 ` Emil Velikov
2016-01-22 19:33 ` Ville Syrjälä [this message]
2016-01-19 3:42 ` Michel Dänzer
2016-01-16 19:49 ` Ilia Mirkin
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=20160122193314.GR23290@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.