This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/23441] New: wrong "control may reach end of non-void function" with -O


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]