Andres Freund <andres@anarazel.de> writes:
> It's worthwhile to note - I forgot this - that noreturn actually has
> been standardized in C11 and C++11. For C11 the keyword is _Noreturn,
> with a convenience macro 'noreturn' defined in stdnoreturn.h.
> For C++11, the syntax is (please don't get an aneurysm...):
> [[ noreturn ]] void funcname(params)...
> (yes, the [[]] are actually part of the syntax, not some BNF like thing)
Egad. I'd *want* to hide that under a macro :-(
> While it looks tempting to just use 'noreturn', and backfill it if the
> current environment doesn't support it, I think that's a bit too
> dangerous, because it will tend to break other code like
> __attribute__((noreturn)) and _declspec(noreturn). As there's plenty
> other software using either or both of these, I don't think it's worth
> going there.
Agreed, defining noreturn is too dangerous, it'll have to be
pg_noreturn. Or maybe use _Noreturn? But that feels ugly too.
Anyway, I still like the idea of merging the void keyword in with
that.
regards, tom lane