www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - how do I activate contracts for phobos functions in dmd

reply Richard Palme <richardpalme tutanota.de> writes:
My guess is that I have to build phobos with:

$make -f posix.mak BUILD=debug

but then what do I do next? I'm using Linux and I built 
dmd+phobos manually by following this guide: 
https://wiki.dlang.org/Building_under_Posix
Nov 02 2018
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Friday, 2 November 2018 at 14:10:35 UTC, Richard Palme wrote:
 My guess is that I have to build phobos with:

 $make -f posix.mak BUILD=debug

 but then what do I do next? I'm using Linux and I built 
 dmd+phobos manually by following this guide: 
 https://wiki.dlang.org/Building_under_Posix
Which phobos functions are used in dmd? there _should_ be none!
Nov 02 2018
parent reply Richard Palme <richardpalme tutanota.de> writes:
On Friday, 2 November 2018 at 16:41:32 UTC, Stefan Koch wrote:
 Which phobos functions are used in dmd?
 there _should_ be none!
I think I didn't phrase the title correctly: I'm using dmd as compiler and want to activate the contracts of phobos functions. For example there's a phobos function std.bitmanip.opIndex implemented like this: bool opIndex(size_t i) const nogc pure nothrow in { assert(i < _len); } do { return cast(bool) bt(_ptr, i); } and when I call this function from my code I want the pre contract to be checked (assert(i < _len)
Nov 02 2018
parent Kagamin <spam here.lot> writes:
Just compile the needed module directly:
dmd myapp.d src/std/bitmanip.d
Nov 03 2018