Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbjade.BERKELEY.EDU Path: utzoo!linus!decvax!ucbvax!ucbjade!mwm From: mwm@ucbopal.BERKELEY.EDU (Mike (I'll be mellow when I'm dead) Meyer) Newsgroups: net.lang.c Subject: Re: Re: Uses of "short" ? Message-ID: <87@ucbjade.BERKELEY.EDU> Date: Tue, 8-Oct-85 21:15:43 EDT Article-I.D.: ucbjade.87 Posted: Tue Oct 8 21:15:43 1985 Date-Received: Fri, 11-Oct-85 07:08:04 EDT References: <486@houxh.UUCP> <3400008@ndm20> <2285@sjuvax.UUCP> <1924@brl-tgr.ARPA> Sender: network@ucbjade.BERKELEY.EDU Reply-To: mwm@ucbopal.UUCP (Mike (I'll be mellow when I'm dead) Meyer) Organization: Missionaria Phonibalonica Lines: 34 In article <1924@brl-tgr.ARPA> gwyn@brl-tgr.ARPA (Doug Gwyn ) writes: >> I am inclined to prefer the use of int16, int32, int64, int8, char. > >int16 => short >int32 => long >int64 => not a primitive data type on all implementations >int8 => signed char >char => char > >Why add more symbols when you already have what is needed in the language? Doug, If someone on a machine that supports 60+ bit ints uses one in their code, and later you have to port it, you should hope they did: typedef long int60 ; /* or whatever the type is for 60 bit ints */ and then used int60 instead of long. You see, if they do that, then when you compile the program and notice it giving you funny numbers (assuming, of course, that you notice :-), a single grep will find all the places where variables you need to worry about are declared. Of course, if there were some standard place to look for those typedefs, and they had included that, then when you compiled the program, it would give you the same list as the grep. Likewise, if *your* code uses int8/int16/whatever correctly, specifying the number of bits needed, then there file of typedefs will get them a reasonable type for those variables.