This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
GCJ/C++ name mangling incompatibility
- To: java at gcc dot gnu dot org
- Subject: GCJ/C++ name mangling incompatibility
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Mon, 12 Mar 2001 13:27:11 +1300
In the following test case, where we want to pass an inner class
reference to a native function, GCJ and C++ will produce conflicting
name manglings. They seem to have different interpretations of the "$"
character!
$ nm ./Test.o | grep foo
00000000 r _Utf1foo
U _ZN4Test3fooEPN13Test__U24_BarE
$ nm ./natTest.o | grep foo
00000000 T _ZN4Test3fooEP8Test$Bar
// Test.java
public class Test
{
class Bar {}
native void foo(Bar b);
void a()
{
foo(new Bar());
}
}
// natTest.cc
#include <Test.h>
#include <Test$Bar.h>
#include <gcj/cni.h>
void
Test::foo (Test$Bar *)
{
}
regards
[ bryce ]