[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 17:45:02 PDT 2009


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



--- Comment #8 from Leandro Lucarella <llucax at gmail.com> 2009-10-30 17:45:01 PDT ---
(In reply to comment #7)
> (In reply to comment #6)
> > LDC already have all the checks splat in different options:
> > 
> > $ ldc --help
> > [...]
> >   -enable-asserts                              - (*) Enable assertions
> >   -enable-boundscheck                          - (*) Enable array bounds checks
> >   -enable-contracts                            - (*) Enable function pre- and
> > post-conditions
> >   -enable-invariants                           - (*) Enable invariants
> >   -enable-postconditions                       - (*) Enable function
> > postconditions
> >   -enable-preconditions                        - (*) Enable function
> > preconditions
> >   -enable-inlining                             - (*) Enable function inlining
> > in -O<N>
> > [...]
> > Options marked with (*) also have a -disable-FOO variant with inverted
> > meaning.
> > $ 
> > 
> > It will be very nice if this switches are included in the reference
> > implementation too.
> 
> I think this is too much configurability that does not reflect principles, only
> mechanism.
> 
> DbC means assert, precondition, postcondition, and invariant are enabled. I
> don't think it's wise to enable or disable those independently.

I don't agree about not providing the option because "it's not wise". Let the
user decide what is wise or not.

That said, I can agree about having that kind of granularity might be not very
useful (there are very very few situations where you might want to enable
preconditions and not postconditions, for example).

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