[fpc-pascal] Why in {$mode delphi} it works and in {$mode objfpc} it doesn't?

Marco van de Voort fpc at pascalprogramming.org
Mon Jan 16 20:58:04 CET 2023


On 16-1-2023 20:56, Giuliano Colla via fpc-pascal wrote:
>
> No chance. Addr is a pointer (of type Pin_addr)
>
> but
>
> Addr := Pin_addr(HostEnt.h_addr^)
>
> works only if mode is Delphi. In objfpc it raises exactly the same error.
>
> A little bit weird, isn't it?
>
It depends. It assumes .h_addr is compatible with pointer.  Since Free 
Pascal is more portable, that might be a platform dependent assumption.


More information about the fpc-pascal mailing list