[toolchain] disable -Wtautological-compare for clang

Alexander Best arundel at freebsd.org
Thu Nov 3 11:01:55 UTC 2011


On Mon Oct 17 11, Warner Losh wrote:
> I'm all for leaving it on because things like char are signed on some architectures and unsigned on others.  This leads to bugs that only appear on one architecture.  This warning will, at least, flag those usages.

-funsigned-char / -fsigned-char could be used in that case.

cheers.
alex

> 
> On Oct 17, 2011, at 10:56 AM, Gerald Pfeifer wrote:
> 
> > On Mon, 17 Oct 2011, Alexander Best wrote:
> >> any chance we could disable -Wtautological-compare for clang? i don't 
> >> think comparing an unsigned int against < 0 is worth a warning. actually 
> >> it's always nice to have such a seatbelt, in case somebody changes the 
> >> type to int and forgets to introduce such a check.
> > 
> > I am on the fence on this one, for when I used the equivalent warning
> > in GCC this did found a number of real issues that I then addressed for
> > Wine (as an example).
> > 
> > Gerald
> > _______________________________________________
> > freebsd-toolchain at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
> > To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe at freebsd.org"
> > 
> > 
> 


More information about the freebsd-toolchain mailing list