File, line and message for assert(0)?

simendsjo simen.endsjo at pandavre.com
Sat May 28 09:32:59 PDT 2011


On 28.05.2011 18:22, Vladimir Panteleev wrote:
> On Sat, 28 May 2011 19:19:25 +0300, simendsjo
> <simen.endsjo at pandavre.com> wrote:
>
>> On 28.05.2011 17:56, Andrej Mitrovic wrote:
>>> Works for me, 2.053 XP32:
>>>
>>> core.exception.AssertError at testsassert.d(3): where's my message, line
>>> and file?
>>
>> Compiling with -release?
>
> http://www.d-programming-language.org/expression.html#AssertExpression
> says:
>
> The expression assert(0) is a special case; it signifies that it is
> unreachable code. Either AssertError is thrown at runtime if it is
> reachable, or the execution is halted (on the x86 processor, a HLT
> instruction can be used to halt execution). The optimization and code
> generation phases of compilation may assume that it is unreachable code.
>

I don't think I understand the use case for assert(0) then.. I thought 
it was just a way getting assert in release mode.


More information about the Digitalmars-d-learn mailing list