View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037085 | FPC | Compiler | public | 2020-05-16 11:48 | 2020-10-10 16:16 |
Reporter | Thaddy de Koning | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | all | OS | all | ||
Product Version | 3.3.1 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0037085: In ISO mode, Dispose with multiple parameters is not yet implemented. | ||||
Description | According to ISO, if new() is used with parameters, dispose should also use parameters. There is an example on the forum here: https://forum.lazarus.freepascal.org/index.php/topic,49834.msg362392.html#msg362392 Why did this not show up before? Dunno. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 45519 | ||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
Mind, multiple parameters (array of const style) and New() and Dispose() should match when used? It has implications for memory layout. Frankly, I did not know it existed and - apart from the forum example - never saw it used. I think this is hard to fix, maybe just document it as incompatible for now. (Scott, do you have more info?) |
|
It would also be interesting to hear if compilers really implement the partial allocation, or if it is an artefact. |
|
FPC at least does not implement partial allocation. The only thing it does if a variant selector is provided is to assign the provided value if it is a named variant selector. So in the example provided on the forum there won't be any difference to not using a variant selector. In the following example however the field b will have the value True. {$mode iso} type v = ^x; x = record n: Integer; case b: Boolean OF True: (x0: Real); False: (x1, x2: Integer) end; var a: v; begin New(a, True); end. That said FPC definitely needs to parse this variant Dispose as well. |
|
It is parsed and semantically checked. The generated code does not change though. If it is common, that an RTE is generated if the record contents and the constants do not match, I can implement this as well. |
|
fpc fails to compile the latest version of the p5 compiler. Among other things, the p5 compiler makes heavy use of dispose with a variant of a record. Lucky me, I still have a version of the p5 compiler from 2010. FPC compiles both pcom and pint with minimal changes, namely assigning commandline parameters to external files and, of course, mode ISO switch! |
|
About which p5 are you talking and about which FPC version? |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-05-16 11:48 | Thaddy de Koning | New Issue | |
2020-05-16 12:26 | Thaddy de Koning | Note Added: 0122850 | |
2020-05-16 12:27 | Thaddy de Koning | Note Edited: 0122850 | View Revisions |
2020-05-16 12:28 | Thaddy de Koning | Note Edited: 0122850 | View Revisions |
2020-05-16 13:40 | Marco van de Voort | Note Added: 0122853 | |
2020-05-17 16:04 | Sven Barth | Note Added: 0122883 | |
2020-05-27 23:25 | Florian | Assigned To | => Florian |
2020-05-27 23:25 | Florian | Status | new => resolved |
2020-05-27 23:25 | Florian | Resolution | open => fixed |
2020-05-27 23:25 | Florian | Fixed in Revision | => 45519 |
2020-05-27 23:25 | Florian | FPCTarget | => - |
2020-05-27 23:25 | Florian | Note Added: 0123102 | |
2020-05-27 23:26 | Florian | Fixed in Version | => 3.3.1 |
2020-07-09 22:37 | Marco van de Voort | Relationship added | related to 0037320 |
2020-10-10 12:32 | Wolfgang Helbig | Note Added: 0126213 | |
2020-10-10 13:18 | Florian | Note Added: 0126215 |