Consider the following code:
goodPointer = ^addr(workVars)
badPointer = ^addr(workVars)
Compiling this in a 32bit world this code "works"; badPointer and goodPointer are "equivalent".
If you compile this code in 64bit however you are playing with fire.
The documentation clearly states that ^ADDR is expected to return a D_ADDR not an
I4, not an I8, a D_ADDR; however there is absolutely NO Compiler check to validate that this guidance was ever followed.
To further compound issues even when using the maximum warning level and compiling in 64bit you get these useless warnings:
Severity Code Description Project File Line Suppression State
Warning %DBL-W-NARROWING, Narrowing conversion could cause loss of data : badPointer = ^addr(workVars) ADDRBugs C:\Users\aceo\source\repos\ADDRBugs\ADDRBugs\Program.dbl 11
Warning %DBL-W-NARROWING, Narrowing conversion could cause loss of data : goodPointer = ^addr(workVars) ADDRBugs C:\Users\aceo\source\repos\ADDRBugs\ADDRBugs\Program.dbl 8
While I would completely agree with the first warning, the second warning is flat out wrong
. x86 happily reports nothing.
This really needs to be a compiler stopping ERROR
(not a WARNING an ERROR