debug = x overrides command line

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 22 13:15:53 PDT 2014


On 10/22/2014 1:04 PM, Jonathan M Davis wrote:
> Yeah, being able to just enable the debug blocks from within the code like
> that seems questionable to me and has nothing to do with debug blocks
> disabling pure functions. It just makes for a nastier side effect when debug
> blocks are enabled within the code rather than via the command-line.

Lots of people (like me, though I'm often told I'm a unique snowflake and nobody 
programs like me) debug code by editting the source code to enable/disable debug 
code rather than messing with the makefile.

Take a look at about any source file in dmd, for example, with the commented out 
printf's, and template.c, with the file scope #define LOG 0.

D needs to support this style of debugging, and the 'debug' conditional with how 
it is set is just the ticket. The feature works as designed and intended.


More information about the Digitalmars-d mailing list