View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036168||Lazarus||Packages||public||2019-10-12 01:23||2019-10-26 20:29|
|Reporter||jamie philbrook||Assigned To||Juha Manninen|
|Status||resolved||Resolution||no change required|
|Summary||0036168: Type helpers for Int64, QWORD report as sizes for 32 bit integers with the 64 bit Laz release only with fpc 3.0.4|
|Description||The 64 bit Lazarus release 2.0.4 with 3.0.4 for windows is reporting 32 bit sizes for Int64 and QWord.|
The 32 bit 2.0.4 is reporting correctly for these types.
|Steps To Reproduce||Place a Qword or Int64 anywhere and use code tools to show the values|
I. // Reports the size of 32 bit not 64 bit.
Int64 does the same;
|Tags||No tags attached.|
|Fixed in Revision|
Indeed TNativeIntHelper and TNativeUIntHelper use a define CPU64BITS which is not set for Codetools for some reason. I guess the compiler itself works correctly.
Where should it be set?
No the compiler does not work correctly, if you reference it in code it is still wrong..
if you look above that code you posted you'll see the QWORD and Int64 implementation with the corrected values but that isn't what's reported. It appears the BINS of the fpc compiler do not match what is in the source files.
however, I found out that fpc 3.3.x has it fixed for the 64 bit port.
And the nativeInt has nothing to do with this. These are 8 byte types regardless and they work fine with the 32 bit port.
so I don't expect this to get fixed.
> No the compiler does not work correctly, if you reference it in code it is still wrong..
> if you look above that code you posted you'll see the QWORD and Int64 implementation with the corrected values but that isn't what's reported.
> It appears the BINS of the fpc compiler do not match what is in the source files.
No, on the contrary the source shows that CPU64BITS is not defined even in a 64-bit compiler and the compiler binary matches.
Codetools gets FPC defines by "fpc -va" as I learned from Mattias.
> however, I found out that fpc 3.3.x has it fixed for the 64 bit port.
Ok. It was an FPC bug and already fixed. Good.
> And the nativeInt has nothing to do with this. These are 8 byte types regardless and they work fine with the 32 bit port.
Ok yes but having i as a QWord variable and Ctrl-clicking i.MaxValue in editor goes to TNativeUIntHelper helper class. Is that a bug in FCP or Lazarus Codetools?
Code Tools is picking this up from the same location as compiled code is getting it from, it appears the INC file that defines the helpers are completely ignored so the source of the info for code tools must be a precompiled source because it's obviously not coming from there.
If you look at the files of the 32 bit install verses the 64 bit of fpc, they are the same, there is nothing different but yet the 32 bit version works.
I can't explain it any more..
Oh well, we'll wait for Lazarus to get the 3.2.x out, I hear that also has the bug fixed.
> ... info for code tools must be a precompiled source ...
No, Codetools reads Pascal sources only.
In Delphi the equivalent feature reads compiled .dcu files.
Well then I can't explain it, the sources look correct to me and are the same in both the 32 and 64 bit fpc, but 32 bit laz works...
Code tools must be looking at a different file than what I am seeing.
No, Codetools was reading the sources just as it should. The TNativeIntHelper is somehow wrongly used for QWord type in FPC 3.0.4 sources. I did not study the sources more.
In FPC trunk TQWordHelper is correctly used instead.
It was a bug in FPC and now it is fixed. Resolving...
|2019-10-12 01:23||jamie philbrook||New Issue|
|2019-10-12 12:11||Juha Manninen||File Added: TNativeIntHelper.png|
|2019-10-12 12:11||Juha Manninen||Note Added: 0118508|
|2019-10-12 12:12||Juha Manninen||Category||Other => Packages|
|2019-10-12 12:12||Juha Manninen||LazTarget||=> -|
|2019-10-12 12:12||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2019-10-12 12:30||Juha Manninen||Note Edited: 0118508||View Revisions|
|2019-10-12 18:15||jamie philbrook||Note Added: 0118519|
|2019-10-12 18:50||Juha Manninen||Note Added: 0118522|
|2019-10-12 18:51||Juha Manninen||Assigned To||=> Juha Manninen|
|2019-10-12 18:51||Juha Manninen||Status||new => resolved|
|2019-10-12 18:51||Juha Manninen||Resolution||open => no change required|
|2019-10-12 18:51||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2019-10-12 18:52||Juha Manninen||Note Edited: 0118522||View Revisions|
|2019-10-12 19:01||Juha Manninen||Note Edited: 0118522||View Revisions|
|2019-10-12 19:04||Juha Manninen||Status||resolved => assigned|
|2019-10-12 19:04||Juha Manninen||Resolution||no change required => reopened|
|2019-10-12 19:04||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2019-10-12 19:05||Juha Manninen||Resolution||reopened => open|
|2019-10-12 19:05||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2019-10-12 20:47||jamie philbrook||Note Added: 0118526|
|2019-10-12 21:36||Juha Manninen||Note Added: 0118528|
|2019-10-12 21:41||jamie philbrook||Note Added: 0118529|
|2019-10-26 20:29||Juha Manninen||Note Added: 0118862|
|2019-10-26 20:29||Juha Manninen||Status||assigned => resolved|
|2019-10-26 20:29||Juha Manninen||Resolution||open => no change required|
|2019-10-26 20:29||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|