Re: Style question: comparison between signed and unsigned?

Benny Amorsen (amorsen@sscnet.com)
23 Sep 1997 04:15:04 +0200


>>>>> "LT" == Linus Torvalds <torvalds@transmeta.com> writes:

LT> And people are seriously considering adding warnings to the
LT> compiler that makes it harder to write correct code that tests for
LT> errors using these standard features? I really don't see the logic
LT> behind that. Warnings are supposed to _help_ you write good code,
LT> not be in the way of doing so.

If you are referring to the fact that egcs is issuing those warnings
by default, it is probably to get better testing of the compiler. Back
when the linux community was using snapshots, those snapshots had
signed/unsigned warnings on by default.

When egcs ships to the great unwashed masses, it will probably get
turned off, though you can turn it back on with a -W<mumble> option.
Exactly like gcc is handling it now.

Personally I think those warnings are useful for debugging, as long as
they are not considered errors but rather, well, warnings about
possible misuse. Just turn those warnings on once in a while, look
through the code, turn them off again. Which is what I intend to do
with the linux kernel the next time I build it -- I recently installed
egcs.

Benny