[cfe-commits] [PATCH] Enhance -Wtautological-compare

Xi Wang xi.wang at gmail.com
Fri Mar 2 09:40:10 PST 2012


On Mar 2, 2012, at 10:18 AM, Joerg Sonnenberger wrote:
> On Thu, Mar 01, 2012 at 11:53:37PM -0500, Xi Wang wrote:
>> 
>> It warns against (char < 0) with -funsigned-char.
> 
> I think that's bad since such conditionals are used as sanity checks,
> e.g. by some implementations of ctype.h.

I didn't make it clear.  The patch doesn't do anything to detect
such options.  I tried the patched code with -funsigned-char and
it was able to warn against (char < 0).  So I guess the warning
should fire on platforms that treat plain char as unsigned char.

- xi




More information about the cfe-commits mailing list