ID:2073467
 
BYOND Version:509
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 49.0.2623.112
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
The following code:
if (DEBUG)
causes a compile time warning of "unused label".

Expected Results:
Since I'm not working with the preprocessor at this point it should interpret "DEBUG" as a variable.

Actual Results:
"DEBUG" appears to be a reserved variable?

Does the problem occur:
Every time? Or how often?
Every time.
In other games?
Yes.
In other user accounts?
Yes.
On other computers?
Yes.

When does the problem NOT occur?
The problem does not occur when another name is used.

Workarounds:
Use a different name than "DEBUG".
The below seems to work correctly on both 509.1319 and 510.1338 on Linux; do you have a full demo that shows the problem? My guess is some of the surrounding code is influencing it.
/world/New()
var/DEBUG = 1
if (DEBUG)
world.log << "DEBUG is true!" // this prints
else
world.log << "DEBUG is false!" // if you change DEBUG to 0 above, this prints instead
del(src)

In my case it's a global variable instead of a local one (and a const variable at that).
Like this?
/var/const/DEBUG = 1

/world/New()
if (DEBUG)
world.log << "DEBUG is true!"
else
world.log << "DEBUG is false!"

(this behaves exactly the same as my first post for me)
If you have debug mode on in Dream Maker, that is probably the cause of this.
I did test with a #define DEBUG above, I couldn't get it to give an "unused label" warning though. If it is debug mode, it's not the same code as I've posted.