Iain Buclaw:

Where GDC has the following to allow developers to mark functions with the backend attribute 'noreturn'.

pragma(attribute, noreturn)
void die()
{
   abort();
}


Potentially this can now be re-written as.

void die() @noreturn
{
   abort();
}


Would you guys stand for such a change to be allowed?

If it's an useful feature, then I suggest to integrate @noreturn in d/dmd too.

If it's useful but Walter doesn't want it or it can't be implemented in dmd, then I suggest to keep using the less common pragma(attribute, noreturn) syntax in gdc, to not clash with missing but potential D features.

Compiler-specific features should never clash with potential future D features.

-------------

Regarding UDAs currently this program gives no warnings:


struct safe {}
@safe void foo() {}
void main() {}


But now foo is not tagged, it's a @safe function. To tag it you have to use:

struct safe {}
@(safe) void foo() {}
void main() {}


Is this name clashing acceptable?

(This is also why adding @noreturn to gdc is a bad idea, increase even more that confusion.)

Bye,
bearophile

Reply via email to