assert(false, "...") doesn't terminate program?!
H. S. Teoh
hsteoh at quickfur.ath.cx
Sat Oct 27 12:10:08 PDT 2012
On Sat, Oct 27, 2012 at 09:03:05PM +0200, Era Scarecrow wrote:
> On Saturday, 27 October 2012 at 18:36:57 UTC, H. S. Teoh wrote:
> >On Sat, Oct 27, 2012 at 08:26:21PM +0200, Andrej Mitrovic wrote:
> >>Maybe related to -release?
> >
> >Haha, you're right, the assert is compiled out because of
> >-release.
>
> Then it is a bug; Unless perhaps it is inside a contract (in/out)
> or debug statement.
No it's not a bug, because the value is *not* known to be zero at
compile-time (it depends on what value you put in the BigInt).
> TDPL pg 326:
> [quote]
> An assertion against a constant that is known to be zero during
> compilation, such as assert(false), assert(0), or assert(null),
> behaves a tad differently from a regular assert.
[...]
T
--
Ph.D. = Permanent head Damage
More information about the Digitalmars-d
mailing list