@noreturn property

Leandro Lucarella luca at llucax.com.ar
Thu Oct 21 15:54:09 PDT 2010


bearophile, el 21 de octubre a las 17:35 me escribiste:
> Nick Sabalausky:
> 
> > One of the nice things about that is you don't have to provide a "fake" 
> > return type. For instance, with your "@noreturn": "@noreturn int foo()" 
> > would be legal, but wouldn't make any sence. And in a way, even "@noreturn 
> > void foo()" isn't great since a "void" return value suggests that it at 
> > least returns.
> 
> I suggest to keep things simpler, minimize changes to other parts of
> D, and avoid creating new keywords for this very minor feature, and
> allow only the signature:
> @noreturn void somefunctioname(...)
> 
> So this is an additive change to D2, and may be added later.

Exactly, this is just an optimization, that's why for me is fine with
a pragma. It would be nice to use a pragma that is understood by all the
compilers (even when all the compilers should not be forced to take
advantage of it). Same thing for inline and other GCC attributes that
seems good for optimizations.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
JUGAR COMPULSIVAMENTE ES PERJUDICIAL PARA LA SALUD.
	-- Casino de Mar del Plata


More information about the Digitalmars-d mailing list