pointer size (Was: Re: "void **" : Is it valid and what does it mean?)

Chris Torek torek at elf.ee.lbl.gov
Thu May 30 12:11:11 AEST 1991


>In article <6001 at goanna.cs.rmit.oz.au> ok at 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 at tellab5.tellabs.com> toth at 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 at ee.lbl.gov



More information about the Comp.lang.c mailing list