Actions

icon Post
text/html Subscribe
text/html Unsubscribe

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

Re: [cxx-abi-dev] Mangling of anonymous unions?


  • To: cxx-abi-dev@xxxxxxxxxxxxxxxx
  • Subject: Re: [cxx-abi-dev] Mangling of anonymous unions?
  • From: Jason Merrill <jason@xxxxxxxxxx>
  • Date: Wed, 18 Dec 2002 17:58:02 -0500

On Wed, 18 Dec 2002 15:54:30 -0500, Jason Merrill <jason@xxxxxxxxxx> wrote:

> I just noticed that the ABI doesn't define a mangling for anonymous
> unions.  This is only really relevant for static local anonymous unions in
> inline functions; all others are private to a translation unit.
>
> The choices would seem to be:
>
> 1) Use the name of the first member.
> 2) Use the name of the largest member.
> 3) Treat them like string literals, perhaps using 'u' instead of 's'.
>
> g++ currently does #2.  But it also fails to allocate space for such a
> union (q.v. g++.brendan/union1.C), so there's no binary compatibility issue
> in choosing a different answer.
>
> My order of preference is 3, 1, 2.  And yes, I'm volunteering to fix g++.

After working on this for a bit, I like #3 much less; it doesn't work very
well for namespace-scope unions, which we might as well mangle the same
way.

Jason