From: Ian Lance Taylor <ian@wasabisystems.com>
To: tromey@redhat.com
Cc: mec.gnu@mindspring.com (Michael Elizabeth Chastain),
gdb@sources.redhat.com
Subject: Re: demangler, java, clinit, $E
Date: Wed, 17 Dec 2003 17:22:00 -0000 [thread overview]
Message-ID: <m3zndrxsuo.fsf@gossamer.airs.com> (raw)
In-Reply-To: <874qvzmnu4.fsf@fleche.redhat.com>
Tom Tromey <tromey@redhat.com> writes:
> >>>>> "Ian" == Ian Lance Taylor <ian@wasabisystems.com> writes:
>
> Ian> For some reason the Java mangler emits a '$' character after a member
> Ian> name, if the name happens to be a C++ keyword with optional trailing
> Ian> '$' characters. I don't know why it bothers to do this.
>
> It's a weird quoting scheme to achieve some kind of CNI compatibility.
> When generating a C++ header from a .class file, we might see a method
> or field with the same name as a C++ keyword. So we add a "$". But
> then this is ambiguous, so if we see keyword + sequence of "$", we add
> one more "$". This scheme doesn't work for static fields or
> methods... some parts of CNI are still half-baked.
I suppose it's far too late to change this now, but in my opinion it
would have been better to include the newly added '$' in the character
count which precedes the name. That is, now we see strings like
"6sizeof$" which I think would be more cleanly represented as
"7sizeof$". That would follow the C++ mangling ABI.
(Actually, the fact that the '$' is not included in the character
count means that you don't need to add a '$' to a name which happens
to be a keyword with a trailing '$'. You can't get a mangling
conflict anyhow, because the C++ compiler will always have a character
count which includes the '$'.)
Ian
next prev parent reply other threads:[~2003-12-17 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-17 0:29 Michael Elizabeth Chastain
2003-12-17 3:52 ` Ian Lance Taylor
2003-12-17 16:17 ` Tom Tromey
2003-12-17 17:22 ` Ian Lance Taylor [this message]
2003-12-20 15:55 ` Ian Lance Taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3zndrxsuo.fsf@gossamer.airs.com \
--to=ian@wasabisystems.com \
--cc=gdb@sources.redhat.com \
--cc=mec.gnu@mindspring.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox