Exception handling

Jeff Sturm jsturm@one-point.com
Tue Aug 27 09:33:00 GMT 2002


> On 26-Aug-2002, Serguei I. Ivantsov <admin@gsc-game.kiev.ua> wrote:
> > Please help me with exception handling under gcc
> > ...
> > Execution stops after "Floating point exception" and never riches catch
> > section.

It seems the term "exception" is confusingly overloaded in the OP's
message.

The try...catch construct is intended to handle C++ exceptions, not signals.
A "floating point exception" from the OS has nothing to do with the
former.

On Wed, 28 Aug 2002, Fergus Henderson wrote:
> This code is not portable.  According to the ANSI/ISO C++ 98 standard,
> your program has undefined behaviour.

Right.  In GCC, it is sometimes possible to throw exceptions from signal
handlers, however it is not portable.  There are examples in libgcj.

Jeff



More information about the Gcc mailing list