This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((cleanup(function)) versus try/finally
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 13 May 03 17:38:19 EDT
- Subject: Re: __attribute__((cleanup(function)) versus try/finally
> 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.
Just FYI, in Ada this is defined and the action depends on how the
cleanup was invoked.