Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!ncar!ico!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: IsUnsigned() function? Message-ID: <17181@haddock.ima.isc.com> Date: 30 Jul 90 22:47:03 GMT References: <1990Jul27.161339.14712@kfw.COM> <8118@ncar.ucar.edu> <1990Jul30.162449.19240@kfw.COM> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Distribution: na Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 21 In article <1990Jul30.162449.19240@kfw.COM> will@kfw.com (Will Crowder) writes: >Side note: can anyone out there give a good explanation as to why >chars were *ever* signed in the first place, The pdp11's byte-to-word instruction did sign extension, so it was cheaper to have chars be signed. Since ASCII fits in the intersection of signed and unsigned char, most of the problems were hidden. >and why ANSI decided not to require either signed or unsigned chars (leaving >it implementation dependent)? Because which one is cheaper is an implementation-dependent issue, and, since most programs don't care (because they don't use char objects as arithmetic quantities), there was no reason to impose an undue burden on them. I think the real mistake was in having `char' do triple duty: it's the atomic text object (for which signedness shouldn't even be an askable question; cf. Pascal), the allocation quantum (probably should have been spelled `byte'), and a small integer type (which should be spelled `short short int'). Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint