According to Esin Andrey on 8/25/2007 4:05 AM:
> utf8.c: In function ‘string_ascii_p’
> utf8.c:94: warning: comparison is always true due to limited range of
> data type
>
Why not this simpler patch, which avoids a branch?
2007-08-25 Eric Blake <[EMAIL PROTECTED]>
* src/utf8.c (string_ascii_p): Avoid compiler warning.
Index: src/utf8.c
===================================================================
RCS file: /sources/tar/tar/src/utf8.c,v
retrieving revision 1.10
diff -u -p -r1.10 utf8.c
--- src/utf8.c 27 Jun 2007 13:30:15 -0000 1.10
+++ src/utf8.c 25 Aug 2007 14:44:31 -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;
}
--
Don't work too hard, make some time for fun as well!
Eric Blake [EMAIL PROTECTED]