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

Re: [PATCH] mm/slab.c remove impossible <0 check - size_t is not signed - patch is against 2.6.1-rc1-mm2


On Thu, Jan 08 2004, Paul Jackson wrote:
> Jason asked:
> > Well, anything wrong in cleaning them [unsigned compare warnings] up?
> 
> It's more important that we write code that will fit in our limited
> human brains than that we write code that will avoid spurious warnings
> from gcc ('spurious' meaning warnings for code that gcc will correctly
> compile anyway).
> 
> Or, see a couple months ago, in a thread with the Subject of:
> 
>   [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len
> 
> in which Linus wrote:
> > That's why I hate the "sign compare" warning of gcc so much - it warns 
> > about things that you CANNOT sanely write in any other way. That makes 
> > that particular warning _evil_, since it encourages people to write crap 
> > code.

That's fine and has its place, no doubt about that. It doesn't cover the
patch in this thread though. The check is dead code. It's a cosmetic
problem though, gcc should not generate the code checking for < 0.

-- 
Jens Axboe

-
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: