Hairy Pixels via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am Do., 10. Aug. 2023, 18:30:
> > > > On Aug 10, 2023, at 5:43 AM, Bernd Oppolzer via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > PTRADD (p, i) - p is type ANYPTR, i is integer, result is of type ANYPTR > > PTRDIFF (p1, p2) - two pointers, the result is integer > > ANYPTR is a predefined type, compatible with every (typed pointer) > > ADDR (x) is a function (borrowed from PL/1), which returns an ANYPTR ... > and it is allowed for all types of variables > > PTRCAST is the same as PTRADD (p, 0) - and is used to cast pointers > between incompatible pointers (not type safe) > > > > Not a bad idea to clarify this. Besides p + 1 the pointer math operators > are difficult to understand and feel antiquated. > Then you simply aren't using them often enough. E.g. the RTTI internal code is full of them and additional typecasts would simply muddle up otherwise relatively clear code. Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal