dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Vesely <jan.vesely@rutgers.edu>
To: "Ilia Mirkin" <imirkin@alum.mit.edu>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] configure.ac: disable annoying warning -Wmissing-field-initializers
Date: Fri, 22 Jan 2016 14:18:13 -0500	[thread overview]
Message-ID: <1453490293.24549.2.camel@rutgers.edu> (raw)
In-Reply-To: <CAKb7Uvh+6ugKLYGhCFVUTCBB7PVCUA--7maDTRu45RyKK5jEvg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3599 bytes --]

On Fri, 2016-01-22 at 12:48 -0500, Ilia Mirkin wrote:
> On Fri, Jan 22, 2016 at 12:47 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Fri, Jan 22, 2016 at 05:40:54PM +0000, Emil Velikov wrote:
> > > On 22 January 2016 at 17:29, Ilia Mirkin <imirkin@alum.mit.edu>
> > > wrote:
> > > > On Fri, Jan 22, 2016 at 12:18 PM, Marek Olšák <maraeo@gmail.com
> > > > > wrote:
> > > > > On Fri, Jan 22, 2016 at 6:13 PM, Emil Velikov <emil.l.velikov
> > > > > @gmail.com> wrote:
> > > > > > On 21 January 2016 at 16:58, Marek Olšák <maraeo@gmail.com>
> > > > > > wrote:
> > > > > > > On Thu, Jan 21, 2016 at 2:09 PM, Emil Velikov <emil.l.vel
> > > > > > > ikov@gmail.com> wrote:
> > > > > > > > On 21 January 2016 at 12:08, Marek Olšák <maraeo@gmail.
> > > > > > > > com> wrote:
> > > > > > > > > On Thu, Jan 21, 2016 at 11:51 AM, Emil Velikov <emil.
> > > > > > > > > l.velikov@gmail.com> wrote:
> > > > > > > > > > On 18 January 2016 at 22:53, Marek Olšák <maraeo@gm
> > > > > > > > > > ail.com> wrote:
> > > > > > > > > > > Try explaining that to people who have a
> > > > > > > > > > > compulsion to fix them or
> > > > > > > > > > > argue about them. :) Ignore? REALLY? IGNORE???
> > > > > > > > > > > 
> > > > > > > > > > Now that we have a few people off your back can you
> > > > > > > > > > please point out
> > > > > > > > > > where this triggers warnings ?
> > > > > > > > > 
> > > > > > > > > This particular warning is trigged by {}
> > > > > > > > As mentioned previously neither {} nor {0} trigger any
> > > > > > > > warning here.
> > > > > > > > Jani hinted that you might be using an old (buggy?)
> > > > > > > > compiler which
> > > > > > > > generates them.
> > > > > > > > Which version of GCC are you using ? Do you mind
> > > > > > > > showing the first few
> > > > > > > > warnings ?
> > > > > > > > 
> > > > > > > > > or any { ... } which doesn't
> > > > > > > > > initialize all members.
> > > > > > > > > 
> > > > > > > > Do we have any outside of intel_decode.c ? I'm failing
> > > > > > > > to spot any.
> > > > > > > 
> > > > > > > amdgpu_bo.c has 7 occurences of "= {}" and they all print
> > > > > > > the warning.
> > > > > > With 200+ cases of memset and 40+ of "= *{ *0 *}". Any
> > > > > > objections if I
> > > > > > send a patch to transition to either one of these two ?
> > > > > 
> > > > > That's up to you, but please note that I don't plan to stop
> > > > > using "= {}",
> > > > > because it's the most convenient way to clear memory in a lot
> > > > > of
> > > > > cases and takes only 4 bytes of text.
> > > > 
> > > > I like {} too and think we should encourage that. I'd rather
> > > > transition the { 0 } stuff over to {}.
> > > > 
> > > So people feel against seeing/writing single extra character 0,
> > > despite that the warning has helped catch actual bug ?
> > > And now are willing to transitions 40+ cases as opposed to ~15...
> > > that
> > > feels strange to say the least.
> > 
> > Does the '= { 0 }' thing even work if the first member happens to
> > be
> > something other than an integer?
> 
> No. That's why I like {}. Otherwise you end up doing
> {{{{{{{{{{0}}}}}}}}}.

ISO C99
According to 6.7.8 20 all braces but the outermost ones are optional.
{}, on the other hand, is not allowed by syntax rules.

Jan


> 
>   -ilia
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
-- 
Jan Vesely <jan.vesely@rutgers.edu>

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-01-22 19:18 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 [this message]
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ä
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=1453490293.24549.2.camel@rutgers.edu \
    --to=jan.vesely@rutgers.edu \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=imirkin@alum.mit.edu \
    --cc=ville.syrjala@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