Another pitfall. Signed chars and ctype.h.

Felix Lee flee at shire.cs.psu.edu
Sat Feb 10 13:27:28 AEST 1990


John Woods <john at frog.UUCP> wrote:
> You have to say
>	isascii(*s) && isdigit(*s)

According to _Standard C_ by Plauger and Brodie (the best reference I
have), there is no "isascii".  And "isdigit" etc. take an int in the
set (EOF, 0..UCHAR_MAX), e.g., the possible return values of fgetc().

So, to write ANSI conformant C you must always say something like
	isdigit((unsigned char) *s)
--
Felix Lee	flee at shire.cs.psu.edu	*!psuvax1!flee



More information about the Comp.lang.c mailing list