Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!gargoyle!ihnp4!ho95e!wcs From: wcs@ho95e.ATT.COM (Bill.Stewart.) Newsgroups: comp.arch Subject: Re: Bad RISC Message-ID: <2035@ho95e.ATT.COM> Date: 5 Mar 88 01:12:40 GMT References: <216@wsccs.UUCP> <3406@bloom-beacon.MIT.EDU> Reply-To: wcs@ho95e.UUCP (46323-Bill.Stewart.,2G218,x0705,) Organization: AT&T Bell Labs 46133, Holmdel, NJ Lines: 18 Keywords: SUN RISC signed chars In article <3406@bloom-beacon.MIT.EDU> peter@athena.mit.edu (Peter J Desnoyers) writes: :The main complaints we seem to have heard about the C compiler for the :SUN 4 are: : 1) it sign-extends characters passed as arguments. This is, I :believe, required by K&R, so it better do so. The problem that bites Gorf, no! K&R says (see pp 40-42) that function arguments are expressions, so they go through the normal type-conversions float->double, char->int, short->int. On machines with signed characters, this does a sign-extend; on machines with unsigned it doesn't. I assume unsigned-chars on a signed-char machine get promoted to unsigned for passing. While I think unsigned-characters are better, K&R leaves this up to the machine-designer, and explicitly warns you to watch out for the difference. So don't blame K&R for Suns's problems, but don't blame Sun if they've followed the rules (as they seem to here.) -- # Thanks; # Bill Stewart, AT&T Bell Labs 2G218, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs