• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
gcc 3.1 and c++ exception ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: gcc 3.1 and c++ exception ?
      • From: Andrew Pinski <email@hidden>
    • Re: gcc 3.1 and c++ exception ?
      • From: email@hidden
  • Prev by Date: Re: AppleShareClient and link errors
  • Next by Date: When to call signal(...)
  • Previous by thread: Re: REPOST: Dynamic Library & UNloading Resource Bundles...
  • Next by thread: Re: gcc 3.1 and c++ exception ?
  • Index(es):
    • Date
    • Thread