[Issue 3407] [tdpl] Compiling with -safe -release must keep all bound checks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 30 07:55:57 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3407



--- Comment #2 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-10-30 07:55:56 PDT ---
(In reply to comment #1)
> I don't understand the reasoning behind this. The primary reason you use
> -release is to turn off bounds checking, because bounds checking is *really*
> slow.
> This change would basically make -safe and -release incompatible in practice:
> why on earth would you use both?
> Up to now, -safe has been entirely about compile-time checks. Here, you're
> making it insert runtime checks as well, so that compile-time safety incurs a
> run-time penalty. I don't like that at all.

To me the charters of -safe and -release are different:

-safe: "Do whatever the hell it takes to make sure my program never has a
memory error"

-release: "I've tested and debugged my programs, eliminate runtime design
checks"

Compiling with -safe implies array bounds checks stay, come hell or high water.
Compiling with -release means the contracts and assert are removed. Those can't
cause memory errors. Only non-safe builds will remove array bounds checks.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list