gotos was: open source awareness [was Re: [FoRK] Fwd: [Processing] download the new beta release!)

Justin Mason jm at
Fri May 20 14:59:45 PDT 2005

Hash: SHA1

Joe Barrera writes:
> Justin Mason wrote:
>  > [Monday, January 17, 2005 8:08 AM by Christoph Hellwig]
> >  I'm a bit suprised no one brought the goto cleanup style used e.g.
> >  about everywhere in the Linux kernel up. I'd look something like
> >  (hope the pasting doesn't screw up the indentation):
> I prefer the testing of variables prior to deleting or closing them
> combined with a single exit label, to the Linux style with multiple
> labels, because if the order of allocation changes, then the order
> of exit labels has to change as well, and it's easy to screw this up
> and either free/close something that shouldn't be, or forget to free/close
> something that should be.

ah, yeah, I would too generally, as a micro-style.  The "macro" picture of
using goto for cleanup, however, still applies as my preference over the
general use of exceptions.

- --j.
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Exmh CVS


More information about the FoRK mailing list