Actions

icon Post
text/html Subscribe
text/html Unsubscribe

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

Mangling of anonymous unions?


  • To: cxx-abi-dev@xxxxxxxxxxxxxxxx
  • Subject: Mangling of anonymous unions?
  • From: Jason Merrill <jason@xxxxxxxxxx>
  • Date: Wed, 18 Dec 2002 15:54:30 -0500

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++.

Jason