Date: Sun, 1 Feb 1998 14:14:10 -0500 (EST) Message-Id: <199802011914.OAA20468@delorie.com> From: DJ Delorie To: eliz AT is DOT elta DOT co DOT il CC: Vik DOT Heyndrickx AT rug DOT ac DOT be, djgpp-workers AT delorie DOT com In-reply-to: (message from Eli Zaretskii on Sun, 1 Feb 1998 19:51:48 +0200 (IST)) Subject: Re: char != unsigned char... sometimes, sigh Precedence: bulk > #define isalnum(c) (__dj_ctype_flags[((c)&0xff)+1] & __dj_ISALNUM) > > That "+1" is designed to make EOF be 0, and the zeroth element of > __dj_ctype_flags[] array should be set appropriately. Doesn't this > work? Given -1, you end up with (-1 & 0xff) + 1, which is 256. You get the same results for 0xff. Unfortunately, you can't tell the difference between -1 meaning EOF and -1 meaning signed character 0xff sign-extended and stored in a signed int variable (0xffffffff).