This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]