Ok, thanks for your answer !!!
I was warned about that stuff because I saw a program that compared some char value to special cgaracters, 'î' for example that was used as a string modifier... I'll don't tell you that it didn't work on gumstix without -fsignedchar ...(heu I told it ...)
> I saw a bug while building a fresh root_fs :
> In file included from regex.c:646:
> regex.c: In function `byte_regex_compile':
> regex.c:3291: warning: comparison is always true due to limited range of
> data type
It probably isn't a bug, just paranoia (althougth I'm hesitant to say
that because it starts to get into "religious" areas about coding).
Personally, I like all of my code to compiler with no errors - no warnings.
Anyways, and example of where this could easily occur is something like:
char x = SomeFunc();
if (( x < 0 ) || ( x > 3 ))
...do something since x is out of range...
On machines where x is signed the condition is OK. On machines where x
is unsigned, the x < 0 part will always fails, since x is always
So, don't sweat the warnings, there are LOTS of them. For the most
part, if it compiles and links, then its OK (at least that's my
I looked at the particular example, which I think is from building
uClibc and the code is:
if (c1 < CHAR_CLASS_MAX_LENGTH)
where c1 is an unsigned char, and CHAR_CLASS_MAX_LENGTH is 256. So the
condition, on this particular machine with this particular
configuration winds up with a redundant test.
Because regex.c is VERY portable, on many other machines in many other
environments this is a very legitimate test.
Vancouver, BC, Canada
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
gumstix-users mailing list