[fpc-pascal] Socket (Depecrated) on FreePascal

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Mar 1 09:39:51 CET 2009

On 01 Mar 2009, at 03:12, Diego Antonio Lucena Pumar wrote:

> function Accept(
> Sock: LongInt;
> var Addr;
> var Addrlen: LongInt
> ):LongInt;
> For my program I need use this interface, and not the modern versions.
> Really, I can't compile the program. The error is provacated by the  
> parameter (var Addr;). In the documentation y can read about this  
> type of argument and indicated that is trated of Variable  
> parameters. I read more and opine that this argument need a  
> reference to a structure INADDR. But a call the function this:
> Saux := Accept(S1, @Addr, sizeof(Addr));

In Pascal, "var" parameters implicitly take the address of the  
argument you pass. So if you pass @Addr, the compiler will try to take  
the address of "@Addr", which does not make sense (you cannot take the  
address of an address). So instead, just pass Addr.


More information about the fpc-pascal mailing list