D-Programming-Language/dmd — pull request #3443 by eco (2014-04-09 07:02:15+00:00)
Title: Add -boundscheck=[all|safe|none] option

Replaces `-noboundscheck` (which becomes deprecated)

Fixes #12550 (bugzilla is currently down for maintenance so I'll reproduce the rationale here)

1. What `-noboundscheck` actually does is confusing. Its purpose is to turn off bounds checking in `@safe` code (and all other code) which comes as a surprise to a lot of people. `-release` turns off bounds checking in non-`@safe` code (which also surprises some people) but leaves it on for `@safe` code.
2. There is currently no way to turn on bounds checking for release builds.
3. There is currently no way to turn off bounds checking for non-`@safe` code without pulling in everything else `-release` does (or turning off bounds checking for `@safe` code too).