What's the deal with -boundscheck?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 5 19:42:05 PDT 2015


On Monday, 6 April 2015 at 02:13:42 UTC, Andrei Alexandrescu 
wrote:
> I've spent the better part of yesterday and today debugging a 
> complex matter involving pointers, reduced to this:
>
> ../dmd/src/dmd -conf= -I../druntime/import  -w -dip25 -m64  -O 
> -release -main -unittest generated/osx/release/64/libphobos2.a 
> -defaultlib= -debuglib= -L-lcurl -run 
> std/experimental/allocator/kernighan_ritchie.d
>
> In this configuration, surprisingly there's no bounds checks 
> inserted. I need to explicitly add -boundcheck=on.
>
> Why the change? I've fought tooth and nail for keeping bounds 
> checking in release mode and with optimizations on, precisely 
> because I think it's a check that's valuable enough to warrant 
> explicit disabling.
>
> Could someone please explain. This is a shame.
>
>
> Andrei

I don't even this is the way? We have a .ptr property. One cause 
use it to disable bound checking.


More information about the Digitalmars-d mailing list