[fpc-pascal] declaration of functions

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Oct 15 11:13:01 CEST 2010


On 15 Oct 2010, at 11:07, Sven Barth wrote:

> Am 14.10.2010 14:50, schrieb Uffe Kousgaard:
>> interface
>> function somefunction(a: integer): integer;
>>
>> implementation
>> function somefunction;
>> begin
>> result:= a*2;
>> end;
>
> Add
>
> {$mode delphi}
>
> at the top of your unit, then this "Delhpi compatible" syntax will  
> be enabled. The two default FPC modes (fpc and objfpc) are more  
> strict than the Delphi one.

As an aside, this has nothing to do with strictness. The reason is  
that FPC and ObjFPC mode allow function overloading without the  
"overload" keyword. So the compiler sees the above as two overloaded  
functions (one public, one private) as opposed to the interface and  
implementation declaration of the same function.


Jonas



More information about the fpc-pascal mailing list