This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On May  8, 2003, Mark Mitchell <mark@codesourcery.com> wrote:

>> Err...  You're not using try/finally above,

> That was my point: try/finally isn't really the ideal construct.

Why not?  See, the finally case doesn't have the rethrow.  It comes
automatically from the semantics of finally.  This is the right
semantics for cleanups.  catch(...) doesn't get it right.

I do agree that the fact that the pthread cleanup is conditional in
the non-unwinding case makes it unsuitable for direct representation
as either a cleanup or a finally.  You need the conditional in either
case.

-- 
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]