On 1/19/23 12:44, Sam James wrote:
_Noreturn is pretty much just an optimisation (and I'm not convinced
that it's _needed_ in a lot of cases, rather just a useful hint).
_Noreturn is not just an optimization: it's also useful for static
checking. For example:
int
f (int x)
{
if (x < INT_MAX)
return x + 1;
error (1, 0, "x is too large");
}
Since error is _Noreturn the compiler knows not to warn that F might
return garbage. It's useful to suppress false alarms, even when Clang is
the compiler.
> Is there any precedent wrt
> handling miscompilations for actively supported compilers in gnulib
and such?
We've run into them before; I don't know of a list of instances.
Generally speaking if the workaround is easy and harmless we can install
it, otherwise we tell users to get a working compiler.