On Mon, 1 Oct 2012, Tomas Hajny wrote:
IIUC, size PtrUint varies by architecture, which is more or less the
point of PtrUint.
Having this variation documented as Darius suggested above makes things
much clearer, because the programmer may be working on one platform and
programming for another (with {$IFDEFS}...).
Yes and no.
You're supposed to treat this as an opaque type, i.e. all you're supposed
to know is that it is:
1) An integer type (signed or not).
2) Same size as a pointer type on all platforms.
If we start specifying when it is of what type, then
a) we need to maintain this.
b) people will start making assumptions.
We exactly need to avoid b)
You're obviously right, but since we include documentation built on a
32-bit architecture as a universal one for all releases/architectures and
since it currently explicitly includes information that 'PtrUInt = DWord',
we should either make sure that this equation doesn't appear in the
documentation (which may be difficult considering how the docs are
created), or (more likely) provide additional information which allows the
reader to interpret the statement correctly. Choosing the right wording
(to stress the opaque nature of this type) is obviously up to you, but a
request for some kind of clarification added to the docs is IMHO
absolutely reasonable.
Absolutely, and I plan to do so :-)
Michael.
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal