This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: namespace namespace
- From: Ian Lance Taylor <iant at google dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Sam Ruby <rubys at intertwingly dot net>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Tue, 07 Jul 2009 10:32:27 -0700
- Subject: Re: namespace namespace
- References: <4A3D95F1.6040803@intertwingly.net> <4A3E55E1.6010705@redhat.com> <4A403949.4090401@intertwingly.net> <4A40A09E.5040502@redhat.com> <9DAA724F-CC05-4A04-8B4D-386238D1D223@bluezoo.org> <7230133d0906230257j6b69373fj1709af1ee85d7bf8@mail.gmail.com> <4A40B4A1.8020007@intertwingly.net> <4A40CD50.3010904@redhat.com> <4A40DBB9.80703@intertwingly.net> <4A40E497.8090601@redhat.com> <4A4139C1.5060806@intertwingly.net> <4A41EF61.4060902@redhat.com> <4A421391.6020901@intertwingly.net> <4A48FC28.60608@redhat.com>
Andrew Haley <aph@redhat.com> writes:
> It turns out that the mangling of C++ keywords used by gcj is completely
> broken:
>
> In particular, when a member name is a C++ keyword, "$" is appended to the
> name. However, this is results in an illegal mangled name so it is not
> possible to refer to the member from CNI code.
>
> Also, the set of C++ keywords in gjavah is different from the set in gcj.
>
> Also, types are not checked for C++ keywords, so javax.xml.namespace.* cannot
> be referenced from CNI code.
>
> This patch fixes the problem.
>
> This is an ABI change. However, the ABI was almost completely broken
> anyway.
Does this require any changes to the demangler? Note that the demangler
currently has a special case for this:
/* A Java mangled name may have a trailing '$' if it is a C++
keyword. This '$' is not included in the length count. We just
ignore the '$'. */
if ((di->options & DMGL_JAVA) != 0
&& d_peek_char (di) == '$')
d_advance (di, 1);
Ian