This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Bug: CNI is incompatible with new C++ ABI
- From: Andrew Haley <aph at redhat dot com>
- To: java at gcc dot gnu dot org
- Date: Wed, 5 Mar 2003 16:28:11 +0000 (GMT)
- Subject: Bug: CNI is incompatible with new C++ ABI
Test case:
export PATH=/home/aph/gcc/install/bin:$PATH
gcj -C foo.java
gcj -c foo.java
gcjh foo
gcjh bar
g++ natfoo.cc -I. -c
gcj foo.o natfoo.o --main=foo
import java.lang.*;
class bar
{
short modCount;
}
public class foo extends bar
{
short size__;
int data;
native void ouch ();
public static void main (String[] s)
{
foo f = new foo();
f.modCount = 99;
f.size__ = 2;
f.data = 0x12345678;
f.ouch();
}
}
#include <stdio.h>
#include "bar.h"
#include "foo.h"
void foo::ouch ()
{
fprintf (stderr, "list: %d %d 0x%x\n",
modCount,
size__,
data);
}
Should print 99 2 0x12345678.
Andrew.