Re: [PATCH] gcc-3.0 warnings

From: Tim Waugh (twaugh@redhat.com)
Date: Sat Mar 24 2001 - 16:51:02 EST


On Sat, Mar 24, 2001 at 01:55:15AM +0100, J . A . Magallon wrote:

>
> On 03.24 Andrew Morton wrote:
> > "J . A . Magallon" wrote:
> > >
> > > The same is with that ugly out: at the end
> > > of the function. Just change all that 'goto out' for a return.
> >
> > Oh no, no, no. Please, no.
> >
> > Multiple return statements are a maintenance nightmare.
> >
>
> Well, I do not want this to restart a religion war.
>
> The real thing is: gcc 3.0 (ISO C 99) does not like that practice
> (let useless things there for someday using them ?).

The GCC warning has nothing to do with the (good) practice of having a
single exit point. It is the difference between this:

...
out:
}

and this:

...
out:
        return;
}

I think that the latter looks better, and the C standard says that
it's also the only one that's correct.

You are the one arguing about coding religion, by saying that
_neither_ of them is any good.

Tim.
*/



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Mar 31 2001 - 21:00:11 EST