Skip to content

Strange difference between 0 and nil ("Can't assign values to an address")

FPC [main], x64
Win 11

program test;
{$pointermath on}

type
  PRec = ^TRec;
  TRec = record
  end;

begin
  argv:=@PRec(0)[0];   // OK
  argv:=@PRec(nil)[0]; // NotOK - "Can't assign values to an address"
end.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information