This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Add TOUPPER/TOLOWER to system.h and clean up ctype stuff
- To: bernds at cygnus dot co dot uk
- Subject: Re: Patch: Add TOUPPER/TOLOWER to system.h and clean up ctype stuff
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 13 Sep 1999 11:55:14 -0400 (EDT)
- Cc: egcs-patches at egcs dot cygnus dot com, gavin at cygnus dot com
> From: Bernd Schmidt <bernds@cygnus.co.uk>
>
> On Mon, 13 Sep 1999, Kaveh R. Ghazi wrote:
>
> > > > - else if (!ISGRAPH(token_buffer[0]))
> > > > + else if (!ISGRAPH((unsigned char)token_buffer[0]))
> >
> > It gets rid of "subscript has type `char'" warnings (because ctype
> > macros are often written as array table lookups) and in the process
> > makes the code 8-bit safe.
>
> Why don't we hide the cast in the ISGRAPH macro?
> Bernd
Because if the parameter is an int you can't distinguish EOF.
So the cast is only valid if the parameter is a char.
http://www.cygnus.com/ml/egcs/1998-Feb/0643.html
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions