Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: int16, int32 Message-ID: <2605@sun.uucp> Date: Sun, 11-Aug-85 16:14:57 EDT Article-I.D.: sun.2605 Posted: Sun Aug 11 16:14:57 1985 Date-Received: Wed, 14-Aug-85 00:33:05 EDT References: <541@brl-tgr.ARPA> <1167@umcp-cs.UUCP> Organization: Sun Microsystems, Inc. Lines: 21 > I beg to differ: I tend to use "int" when 16 bits will suffice and > I'm not concerned with data space, and I think many others would do > the same, especially since the 4BSD Vax PCC compiler (and probably > many other compilers (SysV Vax PCC?)) won't put "register short"s > into registers. (Someday, someone should fix that....) Since "int" is supposed to be the "natural" size of integers on a particular machine, this is the correct thing to do when 16 bits is sufficient but more bits doesn't hurt (i.e., if data space isn't a problem or if the item is in a structure which isn't seen by other pieces of hardware). The S5 VAX PCC puts "register short"s into registers. The S3 VAX PCC did, also, but produced the "poor and sometimes incorrect" code that the 4.xBSD manual referred to; that's why Berkeley change the S3 VAX PCC not to put them into registers. I looked at a couple pieces of code from the S5 VAX PCC. It seemed to do some possibly-unnecessary work, but that may be due to the semantics of sub-longwordlength-arithmetic in C and on the VAX. (I don't know what the "poor and sometimes incorrect" code was, so I wasn't able to see if the S5 VAX PCC generated it or not.) Guy Harris