Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!decvax!tektronix!teklds!copper!stevesu From: stevesu@copper.UUCP Newsgroups: comp.unix.wizards Subject: Re: Supercomputer Unix decisions (really type sizes) Message-ID: <1124@copper.TEK.COM> Date: Sat, 13-Jun-87 18:20:41 EDT Article-I.D.: copper.1124 Posted: Sat Jun 13 18:20:41 1987 Date-Received: Sun, 14-Jun-87 18:37:32 EDT References: <3659@spool.WISC.EDU> <743@geac.UUCP> <4679@columbia.UUCP> <420@elxsi.UUCP> Organization: Tektronix Inc., Beaverton, Or. Lines: 40 Summary: who cares if sizeof(pointer) < sizeof(long)? In article <420@elxsi.UUCP>, len@elxsi.UUCP (Len Mills) writes: > In article <4679@columbia.UUCP> francus@cheshire.columbia.edu.UUCP (Yoseff Francus) writes: > >In article <743@geac.UUCP> daveb@geac.UUCP (Dave Brown) writes: > > > >I seem to recall that when UTS first came out on the Amdahl they > >were using 64 bits per integer. Eventually they went back to 32 > >bits. > > ELXSI went through the same scenario during our development. We started > out with 64-bit longs and 32-bit ints and 32-bit pointers. This was fine, > for a while, until folks with third-party applications code came along. > > Seems that there is a LOT of code in rather large packages that runs on > a lot of machines, all of which have pointers and longs of the same number > of bits. ^^^^^ > > Of course, we changed. Nowadays int, long, and pointer all are 32-bits > and there is a new, absolutely non-portable thingy called a long long > which is 64-bits. Sigh. Wait a minute. I thought that the VAX-induced portability problems were those caused by assuming that ints and _l_o_n_gs (and time_t's, etc.) were the same size. Who said anything about pointers? A lot of people believe that K&R say that sizeof(pointer) == sizeof(int), whereas the true statement is that sizeof(pointer) <= sizeof(an integral type). Code that casts pointers to integers and back can therefore be made more portable (to machines with sizeof(int) < sizeof(pointer) <= sizeof(long)) by casting the pointers to longs. That shouldn't cause any problems, other than the possibility of wasting a bit of space and time on machines where sizeof(int) == sizeof(pointer) < sizeof(long). You don't have to look at 64-bit supercomputers to find one with this property--just consider the pdp11. Have the compounded mistakes and confusion really reached the point where paranoid people must make sizeof(int) == sizeof(long), thus throwing away a perfectly good and useful type? Steve Summit stevesu@copper.tek.com