This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23441] New: wrong "control may reach end of non-void function" with -O
- From: "pierre dot chatelier at club-internet dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2005 13:11:29 -0000
- Subject: [Bug c++/23441] New: wrong "control may reach end of non-void function" with -O
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When turning on optimizations (-O), the following code produces a wrong "control may reach end of
non-void function" warning
inline float f(float x)
{
if ((x > 3.1415927) || (x<0))
return f(-x);
else
return 0;
}
float g(void)
{
return f(0);
}
--
Summary: wrong "control may reach end of non-void function" with
-O
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pierre dot chatelier at club-internet dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23441