Overflows in Phobos

qznc via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 00:05:19 PDT 2016


On Thursday, 28 July 2016 at 00:17:16 UTC, Walter Bright wrote:
> On 7/27/2016 3:47 PM, qznc wrote:
>> On Wednesday, 27 July 2016 at 07:59:54 UTC, Walter Bright 
>> wrote:
>>> "The expression assert(0) is a special case; it signifies 
>>> code that should be
>>> unreachable. If it is reached at runtime, either AssertError 
>>> is thrown or
>>> execution is terminated in an implementation-defined manner. 
>>> Any code after
>>> the assert(0) is considered unreachable."
>>
>> Why that last phrase about "considered unreachable"? If 
>> "AssertError is thrown
>> or execution is terminated" it implies that execution will not 
>> continue after
>> assert(0).
>
> Yeah, you're right.

Another possibility would be "assert(0) never returns". This 
assumes that throwing an exception is not "returning", which is 
reasonable, since control flow does not leave via return 
statement.


More information about the Digitalmars-d mailing list