Should compilers take advantage (abuse) of the new UDA syntax that has been accepted?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Dec 18 13:31:57 PST 2012


On 12/18/12 11:58 AM, Iain Buclaw wrote:
> On 18 December 2012 16:43, Peter Alexander <peter.alexander.au at gmail.com
> <mailto:peter.alexander.au at gmail.com>> wrote:
>
>     On Tuesday, 18 December 2012 at 15:19:58 UTC, Iain Buclaw wrote:
>
>         Should we take this as an opportunity for other compiler
>         maintainers to implement their own compiler-specific predefined
>         attributes?
>
>
>     Please, no!
>
>     Suppose GDC implements @noreturn (or whatever other attribute)
>
>     Later, LDC implements @noreturn separately with slightly different
>     semantics.
>
>     We now end up in a situation where @noreturn cannot be used
>     portably, and neither compiler developer has incentive to change
>     (whoever changes breaks their users code).
>
>
> Provide a situation where @noreturn attribute would mean anything other
> than telling the compiler to assume that the function|| cannot return,
> and I might please you on *that* particular attribute.

One possibility: one compiler assumes @noreturn never returns, whereas 
another enforces that by adding an HLT at the end of the function.

Andrei



More information about the Digitalmars-d mailing list