Author: | some guy I know <[email protected]> | |
Date: | 2/14/2004 5:25:01 AM | |
Subject: | RE: Hard errors | |
char is considered signed in gcc (and, inded, in most x86 compilers), which means that its range is -128 to 127. Therefore, the test str[i] >= 128 will never succeed, because str[i] will never have a value > 127. You can fix this problem by placing #include <limits.h> with other #includes at the beginning of the file, and surrounding the entire "if" statement with #if !defined(CHAR_MAX) || CHAR_MAX > 127 #endif That way, it will compile in the test on machines/compilers that treat chars as unsigned chars (range 0 to 255). The other thing that you can do is declare void fixline(signed char* str) at the beginning of fixnum, and also where it is declared in the .h file. |