>> [Y]ou just need to choose a value for EOF that is out of range for >> signed char. > I recall there being some debate about whether it's actually legal > for EOF to have any value other than -1.
Curious. Do you recall the basis for such a position? I don't have any POSIX reference, and my C reference is for C99. But I don't see anything there that would prohibit making EOF something like, for example, -256. It needs to be "an integer constant expression, with type int and a negative value", but I don't see any particular constraint beyond that. Are more recent C versions more restrictive, or is this a POSIX thing, or is it an interaction of multiple pieces, or what? /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML mo...@rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B