Article View: net.lang.c
Article #9590Re: Signed char - What Foolishness Is This!
From: Henry Spencer
Date: Mon, 20 Oct 1986 19:06
Date: Mon, 20 Oct 1986 19:06
22 lines
1652 bytes
1652 bytes
> 1) Do other C compilers make 'char' a signed quantity by default?
Yes. Almost any C compiler for machines like the PDP11, the VAX, the
8088, and so forth, will.
> 2) What possible justification is there for this default? Is not
> 'char' primarily a logical (as opposed to mathematical) quantity? ...
The problem started with the PDP11, the first machine C was implemented
on. A minor quirk of the 11 made it substantially more efficient to
manipulate characters as signed entities. This hardware quirk has been
carried over, unfortunately, into a good many newer machines that have
imitated the 11 to some degree. Compilers for these machines have a
choice of generating inefficient code or using signed characters. Since
any decent C documentation warns you that the signedness or lack thereof
of characters is not portable, this is considered legitimate.
I believe Dennis is on record as mildly regretting the original decision
to go along with the hardware's prejudices, but it's a bit late now.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,decvax,pyramid}!utzoo!henry
Technical Details
Message-ID:
<7250@utzoo.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<8719@duke.duke.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c,net.micro.pc Subject: Re: Signed char - What Foolishness Is This! Message-ID: <7250@utzoo.UUCP> Date: Mon, 20-Oct-86 15:06:19 EDT Article-I.D.: utzoo.7250 Posted: Mon Oct 20 15:06:19 1986 Date-Received: Mon, 20-Oct-86 15:06:19 EDT References: <8719@duke.duke.UUCP> Organization: U of Toronto Zoology Lines: 22