Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: isascii (was: Another pitfall. Signed chars and ctype.h) Message-ID: <15962@haddock.ima.isc.com> Date: 15 Feb 90 22:40:34 GMT References: <1990Feb12.043324.5259@sq.sq.com> <2448@ditsyda.oz> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 13 In article <2448@ditsyda.oz> evans@ditsyda.oz (Bruce Evans) writes: >Why doesn't ANSI C guarantee isdigit() (etc.) on *all* characters? (The above seems to mean, "both signed and unsigned characters".) Assume a character set in which (char)-1 is printable, e.g. ISO Latin 1. Your proposal would require that isprint((int)(signed char)(-1)) test as true. But isprint(EOF) is required to test false. Thus, this would require that EOF be defined as a value other than -1. This is permitted by the Standard (I'm not entirely sure why), but it would be A Bad Thing to create conditions that *require* it. Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint