[Issue 12550] Deprecate -noboundscheck and replace with more useful -boundscheck= option

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 10 09:29:34 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12550

--- Comment #5 from monarchdodra at gmail.com ---
(In reply to Steven Schveighoffer from comment #4)
> (In reply to monarchdodra from comment #3)
> 
> > Think of it as an option that makes as @safe code actually @trusted.
> 
> No. @trusted code is trusted because the developer guarantees it. @safe code
> is @safe because the compiler guarantees it.

Yeah, which is why the developer uses a compiler switch that says "no need to
do any checking in the safe code, I'm guaranteeing I'm making all my calls in
ways that won't break this safe code". So, yes, does basically become trusted,
because the developer said so.

> @safe code that has no bounds checks basically becomes unqualified code that
> @safe code can call.

*at the developper's request*. Yes.

But like most things, there's a time and place for everything. At worst, it is
a benching switch. Or a profiling switch to see how much the checking is
costing.

--


More information about the Digitalmars-d-bugs mailing list