File, line and message for assert(0)?

Vladimir Panteleev vladimir at thecybershadow.net
Sat May 28 09:22:07 PDT 2011


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.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d-learn mailing list