Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!itsgw!steinmetz!uunet!sco!seanf From: seanf@sco.COM (Sean Fagan) Newsgroups: comp.lang.c Subject: Re: Different pointer representations on the same machine Message-ID: <2310@scolex.sco.COM> Date: 18 Feb 89 22:12:15 GMT References: <3675@arcturus> <1989Feb15.200416.15836@utzoo.uucp> Reply-To: seanf@scolex.UUCP (Sean Fagan) Organization: The Santa Cruz Operation, Inc. Lines: 28 In article <1989Feb15.200416.15836@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <3675@arcturus> evil@arcturus.UUCP (Wade Guthrie) writes: >>I have seen references on the net to computers which have different >>representations for different types of pointers (even some computers >>which represent different types of pointers as different sizes). >> >>Could I have some examples... [Henry talks about word-addressable machines] As Henry said, machines like, oh, Crays and Cybers, which are word-addressible, can stuff more than one char per word, and, for maximum storage efficiency, you use a { word *addr; int offset} combination for char *'s. There are also machines (Primes spring to mind) which have pointers which are the same for all *data*, but in which, say, function pointers will be of a different size. Lastly (the reason for my posting), I go back to Cybers. 60-bit words, 60-bit data registers, 18-bits of address. A * on that machine is 18-bits, while, for convenience sake, all data types are said to be 60-bits. This breaks code that even most careful programmers write (when you print out a pointer, for example, do you typecast it do long and use a %ld format?)... -- Sean Eric Fagan | "What the caterpillar calls the end of the world, seanf@sco.UUCP | the master calls a butterfly." -- Richard Bach (408) 458-1422 | Any opinions expressed are my own, not my employers'.