bad news re: mingw exceptions

Adam Megacz gcj@lists.megacz.com
Wed Feb 27 19:54:00 GMT 2002


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]


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /