Recent

Author Topic: [UNSOLVDABLE ]Frustration setting in with FPC bugs and code in general.  (Read 23727 times)

jamie

  • Hero Member
  • *****
  • Posts: 7526
Re: [UNSOLVDABLE ]Frustration setting in with FPC bugs and code in general.
« Reply #75 on: February 08, 2018, 11:19:17 pm »
as far as I know Integers on 64 are still 32 bit size wise stored in a 64 bit register for parameter passing or
stack push.

 I didn't realize this issue was not happening with the 32 bit port, I normally do all of my test code
with the 64 bit compiler, I just assume most of it should be same, especially when it comes to types that are
suppose to be the same on 64 bit.
 
So Pascal can elevate the statement in its native size which it does as well as Delphi, in other words, Bytes, words
etc use a full native size and from there it makes it easy to perform all the math needed in a compound statement.
 
  The error comes when it gets time to pass the results back to the caller, types are getting altered when they should
not be. In this example, if I want to work with WORD it should remain that way as the type, it is ok and a good idea
to elevate it in the background for processing as PASCAL does, but it can't keep the type that way when its done.

 In most cases I find the compiler does understand this..

 If I have a Function with a WORD parameter and call it with (W+1); it works fine and the compiler does not
complain about it, that is, only if that is the  only function of that name , no overloads.
 
 So the compiler does understand what it needs to do, just not in all cases.



 
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018