emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more macOS Clang assume warnings


From: Paul Eggert
Subject: Re: more macOS Clang assume warnings
Date: Mon, 24 Aug 2020 17:23:07 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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);
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]