bizarre warnings

Todd Vierling tv@pobox.com
Sat Sep 12 16:29:00 GMT 1998


On Sun, 6 Sep 1998, Zachary Alexander Weinberg wrote:

: t-coverage/string-test.inc:314: warning: unsigned value < 0 is always 0
: t-coverage/string-test.inc:346: warning: unsigned value >= 0 is always 1
: 
: These are valid from the compiler's point of view, but the code is correct
: (it's testing corner cases in a complicated macro).  Is there a
: -Wno-something switch that kills these and *only* these warnings?

The warnings are there because of too many code assumptions made in the past
about `char' being signed (among other things, but this is one of the
biggest--`char' is unsigned on platforms such as PowerPC and ARM).

Unfortunately, this is caused by the "-W" option (not, in fact, by -Wall,
which surprises me), and:

: Also, for reference, is there any switch that turns off -W?

No.  After checking source, the relevant variable ("extra_warnings") is
turned on by the -W switch without a specific warning type, and there is no
relevant option to turn it off.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)




More information about the Gcc mailing list