This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/42674] [4.4/4.5 Regression] Bogus "no return statement in function returning non-void" warning
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2010 17:38:26 -0000
- Subject: [Bug middle-end/42674] [4.4/4.5 Regression] Bogus "no return statement in function returning non-void" warning
- References: <bug-42674-14373@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jakub at gcc dot gnu dot org 2010-01-13 17:38 -------
The difference between C and C++ FE is just r138140, i.e. the && !TREE_PUBLIC
check.
Just try
extern void bar (void);
static int foo (void) __attribute__ ((__noreturn__, __used__));
static int
foo (void)
{
while (1)
bar ();
}
which warns both in C and C++. I guess we should just add !TREE_THIS_VOLATILE
(fndecl) check to both C and C++ FE.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-01-09 20:49:10 |2010-01-13 17:38:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42674