This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Add TOUPPER/TOLOWER to system.h and clean up ctype stuff


 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]