Date: Mon, 2 Feb 1998 18:24:11 -0500 (EST) Message-Id: <199802022324.SAA16676@delorie.com> From: DJ Delorie To: eliz AT is DOT elta DOT co DOT il CC: djgpp-workers AT delorie DOT com In-reply-to: (message from Eli Zaretskii on Mon, 2 Feb 1998 18:56:40 +0200 (IST)) Subject: Re: char != unsigned char... sometimes, sigh Precedence: bulk > Will the following solve the problem? > > #define isalnum(c) (__dj_ctype_flags[((c)+1)&0xff] & __dj_ISALNUM) No, because the problem is that EOF ((int)-1) and 0xff ((int)(signed char)-1) ARE THE SAME NUMBER. No amount of logic can tell the difference. What started this thread was an idea to make (char) mean (unsigned char) so that -1 and (char)(0xff) would be different numbers when promoted to (int). That, unfortunately, has many other bad side effects.