From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: Designated initializers for fields in anonymous structs and unions Date: Sat, 2 Aug 2014 13:09:02 -0700 Message-ID: References: <20140731181006.GA13180@cloud> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-vc0-f179.google.com ([209.85.220.179]:60660 "EHLO mail-vc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755068AbaHBUJE (ORCPT ); Sat, 2 Aug 2014 16:09:04 -0400 Received: by mail-vc0-f179.google.com with SMTP id hq11so8814099vcb.10 for ; Sat, 02 Aug 2014 13:09:02 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Christopher Li Cc: Josh Triplett , Sparse Mailing-list On Sat, Aug 2, 2014 at 12:53 PM, Linus Torvalds 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