This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((cleanup(function)) versus try/finally
On Tue, 2003-05-13 at 14:19, Richard Henderson wrote:
> On Tue, May 13, 2003 at 02:06:50PM -0700, Mark Mitchell wrote:
> > In any case, there are some semantics to be defined; if a cleanup throws
> > an exception, what happens?
>
> At present, the old exception doesn't get destroyed, and
> the new exception propagates. I'm not really sure *what*
> should be said except that it's undefined behaviour.
That's perhaps acceptable; "undefined behavior" is at least an
affirmative non-specification.
Calling "abort" would seem to be the C-ish equivalent of the C++
std::terminate.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com