On Sunday, February 24, 2013 13:07:39 Jacob Carlborg wrote: > On 2013-02-24 09:43, Jonathan M Davis wrote: > > Well, there are three aspects to what usually is meant by a debug build: > > > > 1. Debug symbols are compiled in. > > > > 2. Optimizations are not enabled. > > > > 3. Assertions _are_ enabled. > > > > For dmd, the first one is controlled by -g and -gc, the second one is > > controlled by -O (and probably to some extent by -release), and the third > > one is controlled by -release (and to some extent -noboundscheck). But > > what it actually means for a build to be "debug" or "release" really > > isn't all that well defined. It pretty much just boils down to one of > > them being compiled for debugging and development purposes, whereas the > > other is what's used in released code. In general though, when people > > compile release builds, they use all of the various flags for enabling > > optimizations and disabling debug symbols and assertions, whereas when > > they compile debug builds, they disable all optimizations and enable > > debugging symbols and assertions. > > > > But as for inlining, enabling it (or any other optimizations) screw with > > debugging, so they shouldn't be used with any builds which are intended > > for > > debugging, and with the way most compilers' flags work, optimizations > > aren't enabled unless you ask for them, making debug builds the default. > > Then there's the -debug flag as well.
Yeah, which just adds the confusion, because all it does is enable debug bocks and isn't at all what people normal mean by "debug mode" (though it would make sense to use -debug in "debug mode"). The -debug flag is why I generally end up talking about release mode and non-release mode in D rather than release vs debug, as release mode has far more to do with -release than -debug. Heck, you can technically enable -debug with -release and full optimizations turned on. So, useful as -debug may be, its name confuses things. - Jonathan M Davis