John Nemeth <jnem...@cue.bc.ca> writes: > As an interesting point, I came across my second edition copy > of K&R (copyrighted 1988, first edition is still in a box somewhere) > a couple of days ago. It gives the parameters of the is*() functions > as EOF or an int representable as unsigned char.
Well, if we're digging up ancient history ... my first edition K&R (copyright 1978) is right here on my shelf. It describes isspace(c) and friends as macros not functions, and says nothing whatever about the type of "c". It also says pretty directly that the standard library implements them as array lookups. It's difficult to be sure whether they were expected to behave sanely for EOF, or whether that came along later. However, there is an example program with a handwritten character-type-determining function that must deal correctly with EOF, and they suggest that it could be replaced with isalpha + isdigit, so maybe they had that idea even if it's not spelled out. regards, tom lane