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]

Re: exception handling (egsc-1.0.3, linux)


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



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