> On 19 Jan 2023, at 21:20, Paul Eggert wrote: > > 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. > Right, I just meant that we don't tend to care about quieting warnings with older compilers, and it's not useful from a static analysis perspective here either given that older Clangs can't be trusted. It is of course useful as an attribute in general. I don't think either of these things are really a downside to committing the workaround here. If we get folks who get build failures with extra warnings enabled, we can tell them to upgrade their compiler.