www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/04/21:13:32

Date: Wed, 4 Feb 1998 21:13:28 -0500 (EST)
Message-Id: <199802050213.VAA14414@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: eliz AT is DOT elta DOT co DOT il
CC: djgpp-workers AT delorie DOT com
In-reply-to: <Pine.SUN.3.91.980204194047.26711C-100000@is> (message from Eli
Zaretskii on Wed, 4 Feb 1998 19:47:00 +0200 (IST))
Subject: Re: char != unsigned char... sometimes, sigh

> This thread was born out of a concern that our ctype functions don't 
> support EOF.  ANSI C requires this support.  Knowing that funny things 
> will happen in this case doesn't seem to help a bit when we face the sad 
> conclusion that our libc is not fully compliant with the ANSI C standard.

OK, then, how do we fix it?  Is there ever a case where the is*()
functions/macros *care* if it's EOF or 0xff?  The only ones I know of
are tolower/toupper, which return 0 for EOF (funny, toupper/tolower
return *unsigned* char!).  If we change that to return 0xff for EOF,
then it won't matter if EOF==0xff, and we can just mask the value
we're given with 0xff and be done with it (not even add 1).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019