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

Joe Barrera joe at barrera.org
Fri May 20 14:42:11 PDT 2005


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.

- Joe



More information about the FoRK mailing list