This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12293] g++ 3.x outputs wrong mangled names for some "global constructors keyed to"
- From: "carlo at alinoe dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2003 02:35:15 -0000
- Subject: [Bug c++/12293] g++ 3.x outputs wrong mangled names for some "global constructors keyed to"
- References: <20030916001510.12293.carlo@alinoe.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12293
------- Additional Comments From carlo at alinoe dot com 2003-09-17 02:35 -------
Subject: Re: g++ 3.x outputs wrong mangled names for some "global constructors keyed to"
Because "_GLOBAL__I_" is a GNU extention anyway, I can't say that
it really _is_ wrong - this is not covered by any standard as it is.
However, it makes no sense - why would you add garbage behind
those symbols? It looks like it isn't intentional (and therefore
a bug).
Moreoever, it is very unlogical from the point of view of
demangling (my demangler barfs on it) - it would demand dirty
code hacks to make the demangler demangle this.
Also, if you look at the disambiguation part that is used
together with _GLOBAL__N_ (anonymous namespaces), then it has
a length, for example:
65_GLOBAL__N_.....................................................
where the '65' at least tells the demangler how long the garbage is.
Because the length part is missing, this cannot be looked at as an
'encoding': there would be no way to use it as 'encoding' inside a
mangled name that uses an encoding in the middle of a larger
encoding. Perhaps all of this is never a problem, because
1) it is always a symbol that is only local, and
2) the disambiguation part is always the trailing part (so length
doesn't matter).
but, imho - it shouldn't be there. There is nothing to disambiguation
to begin with.
Finally, I didn't put it in the bug report, but there are several
cases of _GLOBAL__I_ symbols *without* this trailing disambiguation
part.