signed vs unsigned pointer warning
Joe Buck
Joe.Buck@synopsys.COM
Fri Oct 8 17:20:00 GMT 2004
On Fri, Oct 08, 2004 at 02:06:23PM +0100, Nick Ing-Simmons wrote:
> >This is a real typical bug. Just recently a bug was found in
> >curl-library, quite a popular little library, which calls
> >isspace(char). The bug was missed for a long time, as it is only
> >triggered with characters with the MSB set, which do not occur often
> >in HTTP headers.
>
> I am reasnably sure that on old SunOS4 systems passing signed char
> to isxxx() was normal and worked. The lookup tables where defined
> in such a way that 128 or so entries before the normal table replicated
> the 2nd half.
Why can't an implementation define isxxx(c) to return something like
table_lookup[(unsigned)(c)]
?
More information about the Gcc
mailing list