On Mon, Jan 05, 2004 at 12:51:10AM +0200, Lauri Tischler wrote: > Nice patch, cleans up all cruft, just one warning remains > > g++ -O2 -g -Wall -Woverloaded-virtual -c si.c > si.c: In member function `void SI::String::decodeText(char*)': > si.c:222: warning: comparison is always true due to limited range of data > type You can fix this by doing the following: --- ./libsi/si.c~ 2004-01-05 01:17:11.000000000 +0100 +++ ./libsi/si.c 2004-01-05 01:12:22.000000000 +0100 @@ -11,6 +11,7 @@ ***************************************************************************/ #include <string.h> +#include <limits.h> #include "si.h" #include "descriptor.h" @@ -219,7 +220,11 @@ break; if ( ((' ' <= *from) && (*from <= '~')) || (*from == '\n') - || ((0xA0 <= *from) && (*from <= 0xFF)) + || ((0xA0 <= *from) +#if (defined CHAR_BIT) && (CHAR_BIT > 8) + && (*from <= 0xFF) +#endif + ) ) *to++ = *from; else if (*from == 0x8A) > Yes, I know I'm nit-picking :) If you were doing that, you would have added -W as a command line option. Then there would appear a lot of more warnings that need some clean-up. But cleaning them up makes only sense, when Klaus agrees to turn on -W during development in the future. Otherwise all these warnings would sneak in again afterwards. Robert -- Robert Schiele Tel.: +49-621-181-2517 Dipl.-Wirtsch.informatiker mailto:rschiele@uni-mannheim.de
Attachment:
pgp00001.pgp
Description: PGP signature