[fpc-pascal] Translate C code
ryan at thealchemistguild.com
Sat Jan 6 09:59:27 CET 2018
> On Jan 6, 2018, at 1:49 PM, Karoly Balogh (Charlie/SGR) <charlie at scenergy.dfmk.hu> wrote:
> PMyStruct = ^TMyStruct;
> TMyStruct = record
> some, fields: integer;
> next: PMyStruct;
> function MEMNEXT(x: Pointer): PMyStruct;
I’m curious about how this is intended to be used. What would the value of x be? This looks like a confusing way to write sizeof(TMyStruct) - Sizeof(pointer) but I’m confused myself.
Also why does @(PMyStruct(nil)^.next not crash? Dereferencing and taking the addressing of a nil pointer sounds like a bad idea.
More information about the fpc-pascal