exception handling (egsc-1.0.3, linux)

Alexandre Oliva oliva@dcc.unicamp.br
Thu Aug 27 16:56:00 GMT 1998


Thomas Binder <binder@iue.tuwien.ac.at> writes:

> It seems that an exception cannot be caught if it is thrown in a function
> which is called via a function pointer. The program terminates with the
> message 

> 	IOT trap/Abort

I can't reproduce your problem with egcs 1.0.3 on RedHat Linux
5.1/alpha nor RedHat Linux 5.0/x86.  Are you sure g++ is really egcs
1.0.3?  Isn't it linking your program with some other version of
libstdc++ or libgcc?  What does the command below print?

  g++ -v -Wl,-v bug.cc -o bug

> #include <iostream.h>
> void f1 ();
> void f2 (void (*ff)());
> class ERR {};
> int main () {
>   try { f1 (); } catch (ERR) { cout << "Caught ERR" << endl; }
>   try { f2 (f1); } catch (ERR) { cout << "Caught ERR" << endl; } }
> void f1 () { throw ERR (); }
> void f2 (void (*ff)()) { (*ff) (); }

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list