Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!stanford.edu!agate!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: pointer size (Was: Re: "void **" : Is it valid and what does it mean?) Message-ID: <13697@dog.ee.lbl.gov> Date: 30 May 91 02:11:11 GMT References: <6001@goanna.cs.rmit.oz.au> <6218@tellab5.tellabs.com> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Distribution: comp Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 50 X-Local-Date: Wed, 29 May 91 19:11:12 PDT >In article <6001@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au >(Richard A. O'Keefe) writes [correctly]: >> But void*, int*, and float* need not even be the same _size_, let >> alone use the same physical representation. In article <6218@tellab5.tellabs.com> toth@tellabs.com (Joseph G. Toth Jr.) writes: >Maybe, on different machines. ... >On a single machine, the size of the pointer is based upon the >addressable range of memory, and is always the same _size_. Where were you last week when this was done to death? Or three weeks ago when it was also done to death? Or eight weeks ago when it was also done to death? Or four months ago when it was also done to death? Or... How many times do we have to tell you? *READ THE FREQUENTLY ASKED QUESTIONS.* [1] On many machines, all pointer types are the same `size and shape' as all other pointer types. These include all the machines you mentioned. [2] On other machines, all pointer types are the same `size' as all other pointer types, but have different `shapes'. One such machine series is the Data General MV series. It has `byte pointers' and `word pointers'. Both are 32 bits, but the bits are IN DIFFERENT POSITIONS in the 32-bit word. [3] On still other machines, the various pointer types are not even the same *size* as each other. One such machine is the IBM PC, where (in mixed models) function pointers and data pointers are different sizes. Or, on some Prime machines, `word pointers' are 32 bits but `byte pointers' are 48 bits. Thus, the statement: void *, int *, and float * are different sizes on different machines. is true but irrelevant. The much stronger statement: void * and int * are different sizes on this machine. is *also* true when one chooses the right referent for `this'. We now return you to your usual netnews babble. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov