Il 10/11/2019 14:36, Jonas Maebe ha scritto:
Hi,

Does anyone know what the accepted/excepted behaviour is regarding the
capture of addresses of var/out/const-by-address/constref parameters?

For example:

var
   g: longint;
   p: plongint;

procedure test(var l: longint);
begin
   p:=@l;
end;

begin
   test(g);
end.

The question is: should the compiler by default assume that such
addresses are not captured, or that they are captured? Does anyone know
if a lot of code exists that does this?

To me p:=@l should be simply refused by the compiler as it happens in case of p:=l.
Marco
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to