[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: any chance of 2.6.0-test*?



> But in this case, the condition was already there..  My point is that if
> you don't need a goto, you shouldn't use it.  Whenever there's an
> obvious way not to use it, don't.

You should not code to avoid a construction that's valid C.
Just use the control structure that comes natural.
Of course "if (c % 2) goto a;" is a crime, but things
like "if (!buffer) goto err_out_nomem;" are better because
the tell you why the code jumps here, it includes an implicit
comment.
if (buffer) {
	/* do stuff */
} else {
	return -ENOMEM;
}
just obscures the logic of the code.
Or look at it another way, if you dislike goto you should
crusade against conditional return as well.

	Regards
		Oliver

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


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
References: