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++/17703] New: [4.0 regression] spurious error about end of function reached


Since recently, I get a warning from this piece of code: 
-------------------- 
int foo(int first) { 
  while (true) { 
    return first; 
  } 
} 
-------------------- 
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -Wall -c x.cc 
x.cc: In function `int foo(int)': 
x.cc:5: warning: control reaches end of non-void function 
 
The message is clearly bogus, since the loop has a return 
statement, but no edge to the end of the while loop. The message 
breaks my nightly -Werror builds since the code is inside libstdc++ 
where I can't fix it (the original code was in std::__unguarded_partition). 
 
This is a regression on mainline that I'd kindly like to ask to have fixed 
soonish... 
 
W.

-- 
           Summary: [4.0 regression] spurious error about end of function
                    reached
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703


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