gcc 3.1 and c++ exception ?
gcc 3.1 and c++ exception ?
- Subject: gcc 3.1 and c++ exception ?
- From: Arno <email@hidden>
- Date: Fri, 10 May 2002 13:02:02 -0400
Hello all...
I was just wondering if anyone could get exception throwing/catching to
work with the gcc 3.1 in the april 2002 beta dev tools?
Because I couldn t : It always abort somewhere after cxa_throw ...
Maybe I don t use exception handling in a way that s correct enough for
3.1, but the same code runs well under 2.95.2.
I d like to use 3.1 because the releases notes let me hope for c++
building time decrease.
thanks for feedback...
arnaud.
PS: here s a sample if someone is willing to help:
***********
MyClass.h
***********
class MyException{
public:
MyException(int, int);
int err;
int Type;
};
class MyClass {
public:
MyClass();
void MyMethod() throw (MyException);
void MyMethod2() throw (MyException);
};
***********
main.cpp
***********
#include "Myclass.h"
MyException::MyException(int a , int b){
Type=a;
err=b;
}
MyClass::MyClass(){
}
void MyClass::MyMethod() throw (MyException){
throw MyException(2,3);
}
void MyClass::MyMethod2() throw (MyException){
try {
MyMethod();
} catch (...) {
int dah=0;
}
}
int main(int argc, const char *argv[])
{
MyClass * MyClassP=new MyClass();
try {
MyClassP->MyMethod2();
} catch (...) {
int dah=0;
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.