This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17703] New: [4.0 regression] spurious error about end of function reached
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2004 20:24:18 -0000
- Subject: [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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