[fpc-pascal] X64 only - Can't determine which overloaded function to call

James Richters james at productionautomation.net
Thu Jun 15 14:20:47 CEST 2017


I have two almost identical programs, but one of them I cannot compile with
Win64, but it works fine with Win32. 

I finally figured out that the difference between the two that seemed to
make a difference was the working one had constants defined, the one with
issues, those constants were changed to variables.

I've managed to reduce it down to the offending line and made some test
programs that demonstrate the issue:

 

This program runs fine with both Win32 and Win64:

 

Const

  BYA=5;

  SYA=10;

Var

  LY:word;

Begin

LY:=Round(30-(BYA+SYA));   

End.

 

This program will only compile with Win32.  With Win 64 I get:

testit.pas(7,5) Error: Can't determine which overloaded function to call.

 

Var

  LY:word;

  BYA,SYA:Byte;

Begin

BYA:=5;

SYA:=10;

LY:=Round(30-(BYA+SYA));    //This is the line producing the error, but why?

End.

 

I'm very confused by this.  It's very clear what to do, and as far as I
know, valid syntax.

 

If I use 

LY:=Round(30-BYA-SYA);   

 

Then it is compiled by both Win32 and Win64 fine.  But this is not what I
always want to do, I have reasons to want it (30-(BYA+SYA)) the original
formula was very long, I reduced it down to this one thing that causes the
problem, I really need to be able to group things the way I want to group
them.

 

Strangely:

LY:=Round(30.1-(BYA+SYA));   

 

Also compiles fine with both Win32 and Win64

 

I am compiling 32bit version with:

fpc testit.pas

 

And compilng 64bit verion with:

fpc -Px86_64 testit.pas

 

Any ideas about this?

 

James

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170615/fb09d25b/attachment.html>


More information about the fpc-pascal mailing list