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

Giuliano Colla giuliano.colla at fastwebnet.it
Mon Jan 16 20:56:37 CET 2023


Il 16/01/23 20:32, Michael Van Canneyt ha scritto:

>
> On Mon, 16 Jan 2023, Giuliano Colla via fpc-pascal wrote:
>
>> .....I stumbled into a problem I don't understand.
> Should that not simply be
>
> Addr := Pin_addr(HostEnt.h_addr^)
>
> (if addr is a pointer)
>
> or
>
> addr:=Pin_addr(HostEnt.h_addr^)^
>
> if Addr is an in_addr record ?
>
>
> Michael.

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?

Giuliano




More information about the fpc-pascal mailing list