Building GNU tar with GCC 4.2.1 on a machine where char is unsigned
elicits this bogus warning:
utf8.c: In function 'string_ascii_p':
utf8.c:94: warning: comparison is always true due to limited range of data type
mv -f .deps/utf8.Tpo .deps/utf8.Po
I observed the problem on Solaris 8 (sparc) but I imagine it happens
elsewhere. I installed this patch:
2007-10-12 Paul Eggert <[EMAIL PROTECTED]>
* src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
warning about "comparison is always true due to limited range of
data type" when char is unsigned.
--- src/utf8.c 27 Jun 2007 13:30:15 -0000 1.10
+++ src/utf8.c 13 Oct 2007 05:49:15 -0000
@@ -91,7 +91,7 @@ bool
string_ascii_p (char const *p)
{
for (; *p; p++)
- if (! (0 <= *p && *p <= 127))
+ if (*p & ~0x7f)
return false;
return true;
}