exception handling (egsc-1.0.3, linux)
Thomas Binder
binder@iue.tuwien.ac.at
Wed Aug 26 06:40:00 GMT 1998
Hallo !
I found a strange behaviour in the exception-handling of egcs-1.0.3.
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
just as if the exception had not been caught at all.
The attached program fragment was compiled with the following command:
g++ bug.cc -o bug
Note that this doesn't happen with the OSF version of the compiler
(same release).
regards,
T.Binder
--
\\\|///
\\ ~ ~ //
( @ @ )
/------------------------oOOo-(_)-oOOo-----------------------------------------\
| Thomas Binder | |
| Institute for Microelectronics|phone: ++43/1/58801-5239 (till Sept.6,1998) |
| Technical University Vienna | ++43/1/58801-36036 (after Sept.6,1998)|
| Gusshausstrasse 27-29 / E360 |fax : ++43/1/5059224 (till Sept.6,1998) |
| A-1040 Vienna | ++43/1/58801-36099 (after Sept.6,1998)|
| A U S T R I A |email: binder@iue.tuwien.ac.at |
\---------------------------------Oooo.----------------------------------------/
.oooO ( )
( ) ) /
\ ( (_/
\_)
#include <iostream.h>
void f1 ();
void f2 (void (*ff)());
class ERR {};
int main ()
{ try { f1 (); } // Working ...
catch (ERR)
{ cout << "Caught ERR" << endl;
}
try { f2 (f1); } // Not working ...
catch (ERR)
{ cout << "Caught ERR" << endl;
}
}
void f1 ()
{ throw ERR ();
}
void f2 (void (*ff)())
{ (*ff) ();
}
More information about the Gcc-bugs
mailing list