Re: [PATCH] gcc-3.0 warnings

Tim Waugh (twaugh@redhat.com)
Sat, 24 Mar 2001 21:51:02 +0000


--sxKBPtypMsgSHGIi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

>=20
> On 03.24 Andrew Morton wrote:
> > "J . A . Magallon" wrote:
> > >=20
> > > The same is with that ugly out: at the end
> > > of the function. Just change all that 'goto out' for a return.
> >=20
> > Oh no, no, no. Please, no.
> >=20
> > Multiple return statements are a maintenance nightmare.
> >=20
>=20
> Well, I do not want this to restart a religion war.
>=20
> 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:

=2E..
out:
}

and this:

=2E..
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.
*/

--sxKBPtypMsgSHGIi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6vRbFONXnILZ4yVIRAi+FAKCe7UzzwcZeULwbQpRFE6enpyCnigCeKQMw
gbiqb3CgtHT6HgiI4ZS00Cs=
=4OC7
-----END PGP SIGNATURE-----

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