Re: [PATCH 2/7] dm: signed/unsigned audit

Linus Torvalds (torvalds@transmeta.com)
Mon, 9 Jun 2003 08:34:25 -0700 (PDT)


On Mon, 9 Jun 2003, Kevin Corry wrote:
>
> On Monday 09 June 2003 09:35, Joe Thornber wrote:
> > signed/unsigned audit.
>
> > - int minor, r = -EBUSY;
> > + unsigned int m, r = -EBUSY;
>
> Looks like "r" should still be signed.

Yes.

Guys, be _very_ careful if you do audits based on the -Wsigned flag to
gcc, because THE WARNING OUTPUT OF GCC IS OFTEN TOTAL CRAP.

I consider the -Wsigned flag to be more harmful than not, since a
noticeable percentage of the warnings are for code that is perfectly ok,
and rewriting the code to avoid the warning can lead to very subtle bugs
(or just makes the code less readable).

Some of the false warnings could probably be fixed with some fairly
trivial value range analysis, and I'm hopeful that -Wsign can some day
actually be worthwhile, but for now I really wish people be very very
careful.

Linus

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