Re: Designated initializers for fields in anonymous structs and unions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 31, 2014 at 7:19 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> I'm quite sure we still screw complex intiializers up . But this makes
> at least Josh's test-case pass, and looks superficially sane.

Hmm. It exposes other problems.

For example, the fact that we look up the identifier now exposes the
fact that "first_subobject()" creates this dummy "EXPR_IDENTIFIER"
expression that has no identifier. That will then cause
"find_identifier()" to fail, which in turn causes convert_ident() to
fail. Resulting in the parse tree having remaining EXPR_IDENTIFIER
nodes, which will later result in "unknown expression (25,0)" errors.

That's easy enough to fix with just adding the proper initializer, ie

    new->expr_ident = field->ident;

to first_subobject().

But the change apparently also exposes some problems with nested
EXPR_POS cases, so now we mis-parse initializers that have multiple
levels of naming, of the type

   struct S a = { .a.b = 1 };

I haven't had the energy to figure out what went wrong with that one,
and I'm getting rather fed up with this for today, so I'm hoping
somebody else finds this at all interesting.

              Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux