version(noboundscheck) + friends

Jonathan M Davis jmdavisProg at gmx.com
Mon Jun 3 19:09:08 PDT 2013


On Monday, June 03, 2013 18:57:07 Timothee Cour wrote:
> A)
> whether the logic is done in compiler or druntime shouldn't matter to user,
> so it'd be nice to use as uniform syntax as possible, ie:
> dmd -version=noboundscheck should be supported (in addition to existing
> -noboundscheck)
> Implementation can then use that version flag to set compiler
> flag -noboundscheck.

I disagree. -version is for user-defined version identifiers, not official ones.

> B)
> noboundscheck can be used in library code as well for similar bounds
> checking semantics: for example, checking index bounds inside a user
> defined opIndex method. Hence distinguishing between compiler flag vs
> version flag doesn't make that much sense.

There isn't a need to disambiguate. If -noboundscheck is used, then 
D_NoBoundsCheck is defined. No one should ever be passing 
-version=D_NoBoundsCheck to dmd. It's exactly the same with versions such as 
linux or X86. It's the compiler that sets those.

> C)
> It was introduced here:
> https://github.com/D-Programming-Language/dlang.org/commit/a4e2aa3ef7e4a6eec
> 1c726ac9492221507cacfcf#version.dd by @alexrp.
> 
> Since it wasn't in any change log, it's recent and makes sense, can we
> start a deprecation path to have D_NoBoundsChecks => noboundscheck ?

That would be up to the compiler devs. I deal with Phobos and to some extent 
druntime but don't do any work on the compiler.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list