[fpc-pascal] Can't determine which overloaded function to call
LacaK
lacak at zoznam.sk
Wed Dec 5 11:55:52 CET 2018
>> helps, but why is it not needed in Win32? Why for Win32
>> "integer"-"integer" is considered as "integer" so compiler can determine
>> which overloaded function to call and for Win64 compiler compiler can
>> NOT determine which overloaded function to call?
>
> It is because as documented at
> https://www.freepascal.org/docs-html/ref/refsu4.html (remarks under
> table 3.2), FPC evaluates integer expressions using the native integer
> type of the platform.
Do you mean: "2. Every integer smaller than the ”native” size is
promoted to a signed version of the ”native” size. Integers equal to the
”native” size keep their signedness. "?
> On Win32 this is 32 bit, while on Win64 this is 64 bit. On the other
> hand, "integer" is always 32 bit in Delphi mode.
>
> This means that on Win32, there is an exact match for overload
> selection in your test program, while on Win64 there is not and the
> int64 -> integer and int64 -> single type conversions have the same
> priority.
I understand now. Although I must say that it is bit unintuitive for me ;-)
So I can workaround using:
function Offset(const Ax,Ay: PtrInt): TRec1; overload;
Thank you for explanation
-Laco.
More information about the fpc-pascal
mailing list