View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031366 | FPC | Documentation | public | 2017-02-08 07:46 | 2017-02-11 15:47 |
Reporter | Thaddy de Koning | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | all | OS | all | OS Version | all |
Product Version | 3.1.1 | Product Build | 35403 | ||
Target Version | 3.2.0 | Fixed in Version | 3.1.1 | ||
Summary | 0031366: maxlongint is declared as a 32 value but longint is system dependent | ||||
Description | maxlongint is declared as a 32 value on all systems in systemh.inc but longint is a system dependent integer type, so maxlongint can not be used on a 64 bit system. | ||||
Steps To Reproduce | Check systemh.inc for maxlongint: it is 32 bit, which is wrong on a 64 bit system unless we are not Delphi compatible with this detail. | ||||
Additional Information | This came up when analysing the code in this link: http://forum.lazarus.freepascal.org/index.php/topic,35751.msg236896.html#msg236896 Delphi says its longint is platform dependent: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Internal_Data_Formats | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 1390 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
http://www.freepascal.org/docs-html/current/ref/refsu5.html#x27-27003r2 If that is correct... which it doesn't seem to be.. the bug is a Delphi incompatibility If I am correct, it is also a bug in the docs. Use this code on 32 bit and 64 bit: program TestOverflowCheck; {$OVERFLOWCHECKS ON} //same as $Q+ {$RANGECHECKS ON} //same as $R+ var i32 : Longint; // not true: longint is a system dependent type begin Writeln(MaxLongint); i32:= MaxLongint + 2; Writeln(i32); readln; end. |
|
There is no bug in the docs. Maybe one day we will add a Delphi64 modeswitch or so, but by default longint will always be 32 bits in FPC. |
|
Can I ask in a separate report to add this to docs as a known incompatibility with Delphi? If that is the case then this can be closed. Your explanation both here and on the forum is clear. |
|
Editted away. I had some apple issue on 64 bit |
|
In your embarcadero reference: "The platform-dependent integer types are transformed to fit the bit size of the current target platform. On 64-bit platforms they occupy 64 bits, on 32-bit platforms they occupy 32 bits (except the LongInt and LongWord types)" I read that as that the longint and longword types are excluded from scaling with 32/64 size. |
|
No on MAC its is expclicitly documented as 64 bit on a 64 bit system. |
|
It says iOS, but that is the "newgen" compiler. It doesn't say explicitely what it does on OS X. Anyway, this is convoluted, moreover I don't see the use of following this. |
|
The bug is delphi compatibility. Currently, longint in FPC is 32-bit, everywhere. I will document this. |
|
Afaik the new linux port is 64-bit and nextgen compiler. It might be wortwhile checking what that does. |
|
Documented that in FPC, longint is 32-bit. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-02-08 07:46 | Thaddy de Koning | New Issue | |
2017-02-08 07:57 | Thaddy de Koning | Note Added: 0098016 | |
2017-02-08 07:58 | Thaddy de Koning | Note Edited: 0098016 | View Revisions |
2017-02-08 08:25 | Jonas Maebe | Note Added: 0098017 | |
2017-02-08 08:59 | Thaddy de Koning | Note Added: 0098018 | |
2017-02-08 09:00 | Thaddy de Koning | Note Edited: 0098018 | View Revisions |
2017-02-08 09:13 | Thaddy de Koning | Note Added: 0098019 | |
2017-02-08 09:16 | Thaddy de Koning | Note Edited: 0098019 | View Revisions |
2017-02-08 09:16 | Thaddy de Koning | Note Edited: 0098019 | View Revisions |
2017-02-08 11:25 | Marco van de Voort | Note Added: 0098020 | |
2017-02-08 12:20 | Thaddy de Koning | Note Added: 0098021 | |
2017-02-08 12:57 | Marco van de Voort | Note Added: 0098022 | |
2017-02-08 14:31 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2017-02-08 14:31 | Michael Van Canneyt | Status | new => assigned |
2017-02-08 14:32 | Michael Van Canneyt | Note Added: 0098026 | |
2017-02-08 14:33 | Michael Van Canneyt | Category | RTL => Documentation |
2017-02-08 15:22 | Marco van de Voort | Note Added: 0098029 | |
2017-02-11 15:47 | Michael Van Canneyt | Fixed in Revision | => 1390 |
2017-02-11 15:47 | Michael Van Canneyt | Note Added: 0098102 | |
2017-02-11 15:47 | Michael Van Canneyt | Status | assigned => resolved |
2017-02-11 15:47 | Michael Van Canneyt | Fixed in Version | => 3.1.1 |
2017-02-11 15:47 | Michael Van Canneyt | Resolution | open => fixed |
2017-02-11 15:47 | Michael Van Canneyt | Target Version | => 3.2.0 |