From: Paul Eggert <eggert@cs.ucla.edu>
To: Sam James <sam@gentoo.org>
Cc: "Gnulib bugs" <bug-gnulib@gnu.org>, "Arsen Arsenović" <arsen@aarsen.me>
Subject: Re: Making _Noreturn a no-op in < Clang 16?
Date: Thu, 19 Jan 2023 13:20:38 -0800 [thread overview]
Message-ID: <1e4c77c2-5d65-0e73-84b8-37d888053a26@cs.ucla.edu> (raw)
In-Reply-To: <B9404A70-AD4B-4F33-943D-8EEE7843AC2B@gentoo.org>
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.
next prev parent reply other threads:[~2023-01-19 21:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 2:09 Making _Noreturn a no-op in < Clang 16? Sam James
2023-01-19 4:17 ` Paul Eggert
2023-01-19 20:44 ` Sam James
2023-01-19 21:20 ` Paul Eggert [this message]
2023-01-19 21:30 ` Sam James
2023-01-20 3:40 ` Paul Eggert
2023-01-20 4:20 ` Sam James
2023-01-20 9:16 ` Paul Eggert
2023-01-20 10:25 ` Bruno Haible
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e4c77c2-5d65-0e73-84b8-37d888053a26@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=arsen@aarsen.me \
--cc=bug-gnulib@gnu.org \
--cc=sam@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).