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

Re: any chance of 2.6.0-test*?


On Sun, 2003-01-12 at 14:58, David Ford wrote:
> The horrific response to the use of "goto" is deprecated in favor of 
> proper use.  A function overloaded with gotos probably should be 
> reworked.  But there there is no need to outright avoid the use of 
> 'goto'.  if()  is simply a conditional test with a goto A or goto B logic.

But if the if() is already there, there is no need to have an additional
goto in the statement,  My version may even be faster than linus'
version because it may save an extra assembler line of code (the beq or
whatever branch statement generated by the if would do the branch during
the if rather than after the if was evaluated and got to the first
statement which was the goto).  Of course, compiler optimizatoins
probably make that particular point pointless to discuss.

> There is a reason for the implementation of goto.  When it all boils 
> down to it, in assembler it's all a matter of JMP with or without a 
> condition.

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.

-Rob

-
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を参照したい場合の設定について」
Follow-Ups: References: