[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:38:20 PDT 2014


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

--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to monarchdodra from comment #5)
> (In reply to Steven Schveighoffer from comment #4)

> > 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.

The developer is not always the builder. e.g. template code.

Note that the developer has this option -- use @trusted instead of @safe.

> 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.

Change @safe to @trusted in the code to test this.

--


More information about the Digitalmars-d-bugs mailing list