assert(false) in release == splinter in eye

Jonathan M Davis jmdavisProg at gmx.com
Mon Oct 11 10:26:31 PDT 2010


On Monday, October 11, 2010 07:31:54 Sean Kelly wrote:
> Christopher Bergqvist Wrote:
> > Hi,
> > 
> > Time for some Sunday nitpicking. While reading TDPL, one thing that stuck
> > out to me was the special behavior of assert(false). Consider the
> > following program compiled with "-release".
> 
> -release is misnamed.  It should be -unsafe or -unchecked or something like
> that.  Range checking for arrays is also disabled, as are contracts. 
> These are all things that some people actually want turned on in
> "released" software.

I thought that bounds checking was supposed to be enabled in release mode unless 
it was @trusted or @system. Of course, given that @safe, @trusted, and @system 
aren't much used at this point (and need work to be properly useable), that 
would mean that most code now would not have it enabled with -release.

What I find worse than -release though is -debug. -debug tends to imply debug 
mode, which in most people's minds is the opposite of release mode, but -debug 
just has to do with enabling debug blocks and has no releation to -release. So, 
both -release and -debug cause at least some level of confusion.

- Jonathan M Davis


More information about the Digitalmars-d mailing list