__attribute__((cleanup(function)) versus try/finally

Mark Mitchell mark@codesourcery.com
Tue May 13 21:41:00 GMT 2003


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



More information about the Gcc mailing list