From: Paul Eggert <eggert@cs.ucla.edu>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Bruno Haible <bruno@clisp.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: more macOS Clang assume warnings
Date: Mon, 24 Aug 2020 17:23:07 -0700 [thread overview]
Message-ID: <87c35fba-515b-18ca-598c-72a0baa94113@cs.ucla.edu> (raw)
In-Reply-To: <5B1F57F1-C671-40D8-8272-2C90E42F2538@acm.org>
On 8/24/20 11:54 AM, Mattias Engdegård wrote:
> The latest assume reformulation caused several warnings like the following when building with Clang:
>
> ../../emacs/src/xwidget.h:171:72: warning: control reaches end of non-void
> function [-Wreturn-type]
> INLINE struct xwidget *lookup_xwidget (Lisp_Object obj) { eassume (0); }
> ^
> ../../emacs/src/eval.c:1571:1: warning: function declared 'noreturn' should not
> return [-Winvalid-noreturn]
> }
> ^
>
> This is with Apple clang version 11.0.0 (clang-1100.0.33.17) but it looks like the same applies to clang trunk.
Thanks for reporting that. I can reproduce the problem with Clang 9.0.1 on
Fedora 31. For the program at the end of this message, 'clang -O2 -Wall'
incorrectly complains "warning: function declared 'noreturn' should not return
[-Winvalid-noreturn]".
Bruno, how about if we go back to how verify.h did 'assume' before the recent
clang-related changes? That would avoid the complaints. It might cost us a few
nanoseconds of performance with clang-generated code but that's no big deal. And
anyway, clang ought to get fixed to generate the slightly-better code with
'verify.h' just as it was.
#include <config.h>
#include <verify.h>
extern void error (int, int, char const *, ...);
_Noreturn void
f (void)
{
error (1, 1, "error");
assume (0);
}
next prev parent reply other threads:[~2020-08-25 0:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 18:54 more macOS Clang assume warnings Mattias Engdegård
2020-08-25 0:23 ` Paul Eggert [this message]
2020-08-26 0:01 ` Bruno Haible
2020-08-26 0:44 ` Paul Eggert
2020-08-27 2:47 ` Richard Stallman
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87c35fba-515b-18ca-598c-72a0baa94113@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=bruno@clisp.org \
--cc=emacs-devel@gnu.org \
--cc=mattiase@acm.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).