> On Aug 8, 2023, at 11:53 PM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> By default @ returns a *untyped* pointer that can be assigned to any pointer 
> type. Thus is compatible with Delphi and can be controlled with the 
> $TypedAddress directive (there's a slight exception to this when you assign a 
> pointer to a function to a function variable (etc) or pass it to such a 
> parameter, because the compiler has to pick the correct overload if there are 
> multiple functions with the same name in scope). 
> 

Oh $TypedAddress, I had learned about this some time ago for another reason. I 
was always programming under the assumption @ was typed and just noticed this 
now.

The next question is why @ is untyped (if it's just for Delphi why isn't it 
behind the Delphi mode). This breaks type safety does it not? 

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to