Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site wjh12.UUCP
Path: utzoo!linus!vaxine!wjh12!kendall
From: kendall@wjh12.UUCP (Sam Kendall)
Newsgroups: net.unix-wizards
Subject: Re:  Why chars unsigned on 3B?
Message-ID: <480@wjh12.UUCP>
Date: Sun, 10-Jun-84 15:59:03 EDT
Article-I.D.: wjh12.480
Posted: Sun Jun 10 15:59:03 1984
Date-Received: Tue, 12-Jun-84 06:33:26 EDT
References: <499@sri-arpa.UUCP>
Organization: Delft Consulting Corp., New York
Lines: 27

> Why do you care whether chars default to unsigned or signed?

I have gotten this question from several intelligent people; I guess the
answer isn't obvious as I thought it was.  There are two main reasons.

(1) I want chars to be signed because making them so provides 8-bit
    signed integers, not otherwise available through C on the 3B.  Some
    object that this type should not exist because it cannot be used
    portably.  But this type can be used portably through parameterization
    of code: 

	#if CHAR_SIGNED
	typedef char SMALLINT;
	#else
	typedef short SMALLINT;
	#endif

    or the like.

(2) Most UNIX machines have signed characters.  Porting is easier to a
    machine with signed characters also.  Sure, I am careful to avoid
    writing programs which depend on signed characters, other than as
    illustrated above; but I have to port other people's programs
    sometimes.  Idealism cannot escape that fact.

	Sam Kendall	{allegra,ihnp4,ima,amd70}!wjh12!kendall
	Delft Consulting Corp.	    decvax!genrad!wjh12!kendall