This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
bad news re: mingw exceptions
- From: Adam Megacz <gcj at lists dot megacz dot com>
- To: java at gcc dot gnu dot org
- Date: 27 Feb 2002 19:31:59 -0800
- Subject: bad news re: mingw exceptions
- Organization: Myself
Ugh, this is really bad; C++ exceptions work, Java exceptions don't
(see below).
Can anybody tell me the differences in how they are implemented? CNI
would lead me to believe that they both get compiled the same way.
This stuff worked in the 12-Dec tree; has anything changed in
exception handling since then? I tried this same program in my old
12-Dec tree and it works.
- a
______________________________________________________________________________
Java only:
public class test {
public static void main(String[] s) {
try {
throw new Exception();
} catch (Exception e) {
}
}
}
$ ./test.exe
Exception in thread "LibgcjInternalFinalizerThread"
______________________________________________________________________________
CNI:
public class test {
public static native void main(String[] s);
}
#include<gcj/cni.h>
#include<stdio.h>
#include<java/lang/Exception.h>
#include "test.h"
void test::main(JArray<jstring>*) {
try {
throw new java::lang::Exception();
} catch (java::lang::Exception* f) {
}
}
$ ./test.exe
[runs with no errors]