-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
Contact Details
No response
Compiler version
v1.18.4
What happened?
sub DoSomething
print "YES"
end sub
a = usr(@DoSomething)When compiled with the default optimization level, this program prints nothing, while it is expected to print YES.
The compiler's optimizer detects the value assigned to the variable a is unused and removes the whole instruction, including the usr call. However, usr is not a pure function so it must not be removed by optimizer.
Workaround: instead of usr write your own sub like this:
sub fastcall Call(address as uinteger)
asm
jp (hl)
end asm
end sub
Call @DoSomethingError and Warning messages
warning: [W150] Variable 'a' is never usedCode of Conduct
- I agree to follow this project's Code of Conduct