linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Christopher Li <sparse@chrisli.org>
Cc: Josh Triplett <josh@joshtriplett.org>,
	Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: Designated initializers for fields in anonymous structs and unions
Date: Sat, 2 Aug 2014 13:09:02 -0700	[thread overview]
Message-ID: <CA+55aFwXGioNQenk1gBPWrDpx2icmthpadTYO1uHzE5co0W4VA@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFzWAZ-ZQ6DSvnj6vQnwCHyDX11an1nOAo43UGaLcfshwg@mail.gmail.com>

On Sat, Aug 2, 2014 at 12:53 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> My stupid test-case is this incredibly hacky thing:

.. actually, that test-case wasn't the one that showed the original
problem, it just ends up testing many of the other cases, notably the
"next_designator() creates that unnamed union case".

The test-case that shows the problem this patch fixes is one that
actually names the unnamed union entry (so instead of the "{ 3 }"
initializer, it uses ".d=3" to initialize the entry in the unnamed
union.

Just to clarify. See the difference in code generation by
"test-linearize" for those two cases (ie "{3}" vs ".d=3" in the
initializer).

          Linus

  reply	other threads:[~2014-08-02 20:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 18:10 Designated initializers for fields in anonymous structs and unions josh
2014-07-31 18:39 ` Linus Torvalds
2014-07-31 18:50   ` Linus Torvalds
2014-07-31 20:55     ` josh
2014-08-02  8:27     ` Christopher Li
2014-08-02 18:09       ` Christopher Li
2014-08-01  2:19 ` Linus Torvalds
2014-08-01  2:41   ` Linus Torvalds
2014-08-02  1:16     ` Linus Torvalds
2014-08-02  5:16       ` Christopher Li
2014-08-02 18:10         ` Linus Torvalds
2014-08-02 18:31           ` Derek M Jones
2014-08-02 18:40             ` Christopher Li
2014-08-02 19:53           ` Linus Torvalds
2014-08-02 20:09             ` Linus Torvalds [this message]
2014-08-06  9:15             ` Christopher Li
2014-08-01  2:41   ` Josh Triplett

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=CA+55aFwXGioNQenk1gBPWrDpx2icmthpadTYO1uHzE5co0W4VA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /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;
as well as URLs for NNTP newsgroup(s).