This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: implement __attribute__((cleanup(function)))
On May 6, 2003, Daniel Jacobowitz <drow@mvista.com> wrote:
> I'm confident that, even if we revert position on try/finally, that
> will not force us to remove __attribute__((cleanup)). It's really a
> very simple extension...
FWIW, I agree. The issues I brought up have been explained and now my
concerns about it are gone, even if the documentation might have to be
expanded to cover these issues, by perhaps declaring certain cases
undefined or explaining how multiple cleanup attributes in different
variables (or maybe in the same variable?!?) interact.
It's very sad though that an extension that is this --X-- close to the
well-known and well-defined try/finally had to be invented, and
introduced in a way that doesn't let one implement try/finally as
preprocessor macros.
I think I see a way to implement TRY/FINALLY/ENDFINALLY, though, and
this is probably good enough, with the advantage that we don't commit
to a try/finally design that may end up not making it to the
standards.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer