@noreturn?

Iain Buclaw ibuclaw at ubuntu.com
Sun May 13 11:08:42 PDT 2012


On 13 May 2012 17:13, Alex Rønne Petersen <xtzgzorex at gmail.com> wrote:
> Hi,
>
> If memory serves me right, there were some proposals in the past to add a
> @noreturn attribute to the language. Where did this go?
>
> In writing unwinding mechanisms for my VM, I find myself actually needing
> some sort of @noreturn function attribute that would tell the compiler that
> the function does not return, rather than having to insert an assert(false);
> statement.
>

I proposed it - and it didn't go anywhere. :^)

Only way to hint it at the moment would be to use gdc and
pragma(attribute, noreturn) - you still need the assert(0) at the end
though to stop the frontend producing a compile time error.


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list