Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!floyd!whuxle!mit-eddie!genrad!decvax!mcnc!rti!rti-sel!trt From: trt@rti-sel.UUCP Newsgroups: net.unix-wizards,net.lang.c Subject: Re: Why chars unsigned on 3B? Message-ID: <1123@rti-sel.UUCP> Date: Mon, 11-Jun-84 13:43:53 EDT Article-I.D.: rti-sel.1123 Posted: Mon Jun 11 13:43:53 1984 Date-Received: Tue, 12-Jun-84 07:02:43 EDT References: utzoo.3947 <310@basser.SUN>, <479@wjh12.UUCP> Lines: 20 Some compilers make chars signed, others make them unsigned. I wonder if any choose randomly (:-)). I suppose there are some interesting language questions involved here but the major effect is to slow down program porting. A "solution" to the signed/unsigned char problem: One of the niftier features of the Gould UTX port is that the compiler can generate code to emulate either signed or unsigned chars. That is, "cc foo.c" generates code for signed chars (VAX-like) whereas "cc -XU foo.c" generates unsigned code (Amdahl-like). The default code is VAX-like for the obvious reason. Programs that were written on, say, a 68K should probably be compiled '-XU'. Hack though it be, it sure does save time. By the way, our Gould Concept needs two instructions to sign-extend a byte. However, in usual cases (e.g. while(*p++ = *q++);) the sign-extension is not required and is not generated. Tom Truscott