Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-06 Thread wjoe via Digitalmars-d-learn
On Thursday, 5 August 2021 at 11:54:38 UTC, Mike Parker wrote: On Thursday, 5 August 2021 at 10:43:01 UTC, wjoe wrote: Could you elaborate on ```version(assert)``` a bit more, please ? Like I compiled with ```-release, -g``` and without the 2 options but the ```assert``` branch was always

Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-06 Thread wjoe via Digitalmars-d-learn
On Thursday, 5 August 2021 at 11:01:56 UTC, Adam D Ruppe wrote: On Thursday, 5 August 2021 at 09:18:08 UTC, wjoe wrote: If it's to be determined whether or not the code is being compiled in debug or release mode, i.e. e.g. the dmd ```-release``` You should never use the -release flag. It

Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 August 2021 at 10:43:01 UTC, wjoe wrote: Could you elaborate on ```version(assert)``` a bit more, please ? Like I compiled with ```-release, -g``` and without the 2 options but the ```assert``` branch was always taken. Could it be that ```-unittest``` has something to do

Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-05 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 5 August 2021 at 09:18:08 UTC, wjoe wrote: If it's to be determined whether or not the code is being compiled in debug or release mode, i.e. e.g. the dmd ```-release``` You should never use the -release flag. It should be renamed to "-enable-security-holes" since that's what it

Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-05 Thread wjoe via Digitalmars-d-learn
On Thursday, 5 August 2021 at 10:08:12 UTC, Mike Parker wrote: On Thursday, 5 August 2021 at 09:18:08 UTC, wjoe wrote: Given that we have `version(assert)` and `version(D_NoBoundsChecks)`, it probably makes sense to also have equivalents to test if contracts are enabled, or if bounds checking

Re: Conditional compilation: Which version identifier for release code ? version(assert) ?

2021-08-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 August 2021 at 09:18:08 UTC, wjoe wrote: If it's to be determined whether or not the code is being compiled in debug or release mode, i.e. e.g. the dmd ```-release``` or ```-g``` options, which version identifier is supposed to be used ? There's no ```release``` identifier and