[LLVMbugs] [Bug 4831] Empty non-void noreturn function gives wrong diagnostic

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Aug 29 23:24:57 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4831


Daniel Dunbar <daniel at zuster.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel at zuster.org
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Daniel Dunbar <daniel at zuster.org>  2009-08-30 01:24:57 ---
The warning is correct, the function can return when it should not. Perhaps the
phrasing could be better?

gcc says "does return", instead.

--
ddunbar at giles:tmp$ cat t.c
__attribute__((noreturn)) int foo() { }

ddunbar at giles:tmp$ gcc -c t.c
t.c: In function 'foo':
t.c:1: warning: 'noreturn' function does return
ddunbar at giles:tmp$ clang -c t.c
t.c:1:39: error: function declared 'noreturn' should not return
[-Winvalid-noreturn]
__attribute__((noreturn)) int foo() { }
                                      ^
1 diagnostic generated.
--


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list