This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

asynchronous-exceptions handling


// The -fasynchronous-exceptions flags is not
working !
// here is a sample of an exception thrown from a
signal
// handler. This exception terminates the program
although
// it is a wrapped with "catch" statement.
// Note: this bug doesn't occur on gcc-2.7.x!!!
// compile with g++ -v -g  -fasynchronous-exceptions
a.cc
// on sun ultra1 running solaris 5.7

class DphError {
  int errorNum;
};

#include <fstream.h>
#include <signal.h>

static void dphErrHandler(int intruptNumber)
{
  cerr<<"Received signal\n";
  throw DphError();
}

int my(const char * val)
{
  //throw DphError();
  cout<<strlen(val)<<endl;
}
int main(int argc, char *argv[]) {
  signal(SIGSEGV,dphErrHandler);
  try {
    my(NULL);
  } catch (...) {
    cout << "catched"<<endl;
  }
}


begin:vcard 
n:Shahav;Rabin
tel;work:+972-9-9522659
x-mozilla-html:TRUE
org:Motorola Semiconductor Israel;Cad
adr:;;Shenkar 1;Hertzelia;;;Israel
version:2.1
email;internet:Rabin.Shahav@motorola.com
x-mozilla-cpt:;28464
fn:Rabin Shahav
end:vcard

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