Re: Designated initializers for fields in anonymous structs and unions

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

 



On Fri, Aug 1, 2014 at 10:16 PM, Christopher Li <sparse@xxxxxxxxxxx> wrote:
>
> Sorry I am late for the party. This approach assume the anonymous
> structure is only referenced inside the structure.

It does indeed. I thought that was ok.

> There is not other
> external reference. However, that assumption is not true if "-fplan9-extensions"
> or "-fms-extensions" was enabled. Sparse current does not support these
> two extensions. But it will be a problem if we support them down the road.

.. and in fact I think even without those things, you can just make
the unnamed union have a type name, ie

   struct S {
      union T {
          int a;
      }
   };

the union T has a typename, but is a unnamed member of struct S. We
could use "union T" later.

> Actually, the "find_identifier" call inside function "check_designators" already
> calculate the correct offset. Only if we can pass that offset to
> "convert_ident()".

I actually tried that initially, and wanted to get rid of the whole
"check_designators()" vs "convert_designators()", but couldn't really
find a sane way to make that work. I'll look at it again, maybe I
missed something.

             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