[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
egcs question
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: egcs question
- From: ian_(_at_)_darwinsys_(_dot_)_com (Ian Darwin)
- Date: Sat, 25 Sep 1999 22:54:27 -0400 (EDT)
Some code that I'm trying to put into a port, always gives this message:
warning: comparison is always true due to limited range of data type
The code is, slightly extracted:
static inline void Cerr(char ch)
{
cerr << (char) (ch > 0 && ch < 0x00C0 ? ch : ' ');
}
Now the datatype "char" should range from 0 to 0xff, so it ought
not be the case that the comparison
(ch>0 && ch<0xC0)
is always true. Is the leading 0x00 confusing it? Or am I missing
something obvious due to lack of sleep?
Thanks if you can help.
Ian Darwin
ian_(_at_)_darwinsys_(_dot_)_com
Visit your host, monkey.org