This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re: Réf. :c++ exceptions and signals
- To: jbuck at Synopsys dot COM, paulf at aphrodite dot com
- Subject: Re: Re: Réf. :c++ exceptions and signals
- From: mrs at wrs dot com (Mike Stump)
- Date: Tue, 12 Jan 1999 18:29:00 -0800
- Cc: egcs at cygnus dot com
> From: "Paul Forgey" <paulf@aphrodite.com>
> Date: Mon, 11 Jan 1999 22:13:00 -0800
> I can see how exceptions and signals cannot be both the same,
> unlike, say, Win32, where the stack is unwound rather than letting
> the code return from interrupt, allowing destructors to be called.
> But that also spells disaster if your signal handler never returns
> :).
> So if I set up a try()/throw()/catch(), can it (and if so, how?) catch a
> SIGFPE, SIGTERM, SIGILL, etc, with the same semantics as a throw() ? Is
> there definative documentation on this somewhere?
You sound like a user asking a C++ question, the C++ answer is that
portably you can only set a volatile variable of sigatomic_t, as I
recall in a signal handler. It was really limiting. Any C++ book
should say what you can do in a signal handler, and as I recall, throw
wasn't one of them.
Now, if you want to rely upon non-portable behavior, don't do this,
unless you have a really good reason. :-) No, there aren't many/any
documents that describe all the gory details of non-portable code.