This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: signed vs unsigned pointer warning
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Nick Ing-Simmons <nick at ing-simmons dot net>
- Cc: jamie at shareable dot org, gcc at gcc dot gnu dot org,"'Morten Welinder'" <terra at gnome dot org>, Dave Korn <dk at artimi dot com>
- Date: Fri, 8 Oct 2004 09:17:14 -0700
- Subject: Re: signed vs unsigned pointer warning
- References: <20040922161751.B4F6A1422D53@darter.rentec.com><NUTMEGODkUqESudbgsy00000021@NUTMEG.CAM.ARTIMI.COM><20040926192142.GA29842@mail.shareable.org> <20040926192142.GA29842@mail.shareable.org> <20041008130623.9516.4@llama.elixent.com>
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)]
?