Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!bu-cs!buengc!shaun From: shaun@buengc.UUCP Newsgroups: comp.lang.c Subject: Re: Standard int sizes Message-ID: <103@buengc.BU.EDU> Date: Wed, 15-Apr-87 17:01:30 EST Article-I.D.: buengc.103 Posted: Wed Apr 15 17:01:30 1987 Date-Received: Fri, 17-Apr-87 03:42:06 EST References: <6759@brl-adm.ARPA> <230@ems.UUCP> <170@vianet.UUCP> <3286@pogo.TEK.COM> Distribution: na Organization: Boston U. Engineering Dept. Lines: 9 Keywords: int, short Summary: where's the standard? why not be more descriptive It is clear that there is no standard length for int. It is also good to tell how much range you need for a variable because it helps the code be self documenting. Studies of values used in programs shows that most are very small with 0 and 1 predominating. These small values can be given their own special arithmetic instructions that take only one fetch (incr is obvious). Compilers could do a better job if they knew down to the byte what size is needed even considering that the ALU doesn't care. The only portability problem I had with my last large C program was differing interpretations of int (VAX to IBM-PC). -Shaun (int4, int8, int_time_to_transubstantiate)