View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036053 | FPC | Compiler | public | 2019-09-06 21:11 | 2019-10-06 09:48 |
Reporter | Bloodbatgot | Assigned To | Marco van de Voort | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | MS-DOS 16 bit | OS | Windows | ||
Product Version | 3.0.4 | ||||
Summary | 0036053: The MS-DOS 16 bit cross compiler refuses to compile when using an array with valid ranges. | ||||
Description | When trying to compile a 64000 byte array the cross compiler for MS-DOS refuses, even if -WmLarge is used. It is valid code: Turbo Pascal compiles it without a hitch and it is a way to, for example, access VGA memory to write to it. | ||||
Steps To Reproduce | Create an array with a range from 0 to 63999 (check the attached sample file), try to cross compile it for MS-DOS, the compiler refuses with an error: "Error: The range of the array is too large". If the same code is tried with dynamic arrays and SetLength, the compiler emits a warning: "Warning: range check error while evaluating constants (64000 must be between -32768 and 32767)" And, indeed, the program stops when trying to run it with an error 201. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
test64.pas (98 bytes)
unit Test64; interface type TArray64 = array[0..63999] of byte; implementation end. |
|
The constants are 16 bit integers. Did you try casting it ? [0..DWORD(64000)] of Byte ? Or use LongInt(64000) Worth a try anyways. |
|
Or Use WORD(64000), almost forgot that one.. |
|
I didn't at first; but, after your suggestion, now I have. Same error: array range too large. |
|
I can't believe TP <= 5.5 accept that code. At least 3.0 fails, have to test 5.5. It may be just the last incarnation of BP7 accepted it, but I haven't got that anymore. IIRC that is huge model only anyway. [edit] TP 5.5 also does not accept it. This is not true: "When trying to compile a 64000 byte array the cross compiler for MS-DOS refuses, even if -WmLarge is used. It is valid code: Turbo Pascal compiles it without a hitch" AFAIK not even BP7.0 compiles that in large mode. |
|
confirm: TP7 can compile given test sample for dos real mode. |
|
My TP6.0 has no issues with that, its valid code it should compile.. This is only a type being defined |
|
Thaddy: if PROPERLY defined (array[0..63999] of byte) does indeed compile under TP 5.5. |
|
Seems to be fixed in trunk. |
|
So can close then? |
|
Yeah, can close. |
|
As requested |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-09-06 21:11 | Bloodbatgot | New Issue | |
2019-09-06 21:11 | Bloodbatgot | File Added: test64.pas | |
2019-09-07 00:41 | jamie philbrook | Note Added: 0117962 | |
2019-09-07 00:44 | jamie philbrook | Note Added: 0117964 | |
2019-09-07 12:27 | Bloodbatgot | Note Added: 0117968 | |
2019-09-08 14:45 | Thaddy de Koning | Note Added: 0117993 | |
2019-09-08 14:46 | Thaddy de Koning | Note Edited: 0117993 | View Revisions |
2019-09-08 14:48 | Thaddy de Koning | Note Edited: 0117993 | View Revisions |
2019-09-08 14:50 | Thaddy de Koning | Note Edited: 0117993 | View Revisions |
2019-09-08 15:37 | Marģers | Note Added: 0117994 | |
2019-09-08 18:26 | jamie philbrook | Note Added: 0117997 | |
2019-09-09 17:16 | Bloodbatgot | Note Added: 0118005 | |
2019-09-09 17:17 | Bloodbatgot | Note Edited: 0118005 | View Revisions |
2019-10-03 12:48 | Bloodbatgot | Note Added: 0118270 | |
2019-10-04 14:16 | Marco van de Voort | Assigned To | => Marco van de Voort |
2019-10-04 14:16 | Marco van de Voort | Status | new => feedback |
2019-10-04 14:16 | Marco van de Voort | FPCTarget | => - |
2019-10-04 14:16 | Marco van de Voort | Note Added: 0118321 | |
2019-10-04 23:44 | Bloodbatgot | Note Added: 0118338 | |
2019-10-04 23:44 | Bloodbatgot | Status | feedback => assigned |
2019-10-05 17:52 | Marco van de Voort | Status | assigned => resolved |
2019-10-05 17:52 | Marco van de Voort | Resolution | open => no change required |
2019-10-05 17:52 | Marco van de Voort | Note Added: 0118353 | |
2019-10-06 09:48 | Bloodbatgot | Status | resolved => closed |