View Issue Details

IDProjectCategoryView StatusLast Update
0036168LazarusPackagespublic2019-10-26 20:29
Reporterjamie philbrookAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.0.4Product Build64 bit for windows. 
Target VersionFixed in Version 
Summary0036168: Type helpers for Int64, QWORD report as sizes for 32 bit integers with the 64 bit Laz release only with fpc 3.0.4
DescriptionThe 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 ReproducePlace a Qword or Int64 anywhere and use code tools to show the values

Var
  i:Qword;
begin
  I. // Reports the size of 32 bit not 64 bit.

End;
 Int64 does the same;
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Juha Manninen

2019-10-12 12:11

developer   ~0118508

Last edited: 2019-10-12 12:30

View 2 revisions

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?



TNativeIntHelper.png (29,338 bytes)
TNativeIntHelper.png (29,338 bytes)

jamie philbrook

2019-10-12 18:15

reporter   ~0118519

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.

Juha Manninen

2019-10-12 18:50

developer   ~0118522

Last edited: 2019-10-12 19:01

View 3 revisions

> 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?

jamie philbrook

2019-10-12 20:47

reporter   ~0118526

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.

Juha Manninen

2019-10-12 21:36

developer   ~0118528

> ... info for code tools must be a precompiled source ...

No, Codetools reads Pascal sources only.
In Delphi the equivalent feature reads compiled .dcu files.

jamie philbrook

2019-10-12 21:41

reporter   ~0118529

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.

Juha Manninen

2019-10-26 20:29

developer   ~0118862

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...

Issue History

Date Modified Username Field Change
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