This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36254] wrong "control reaches end of non-void function" warning
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2008 18:19:53 -0000
- Subject: [Bug c++/36254] wrong "control reaches end of non-void function" warning
- References: <bug-36254-7667@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from manu at gcc dot gnu dot org 2008-10-22 18:19 -------
The return is generated because we generate one (if there is none) everytime we
reach the end of a function. This is used later to produce "control reaches end
of non-void function". The compiler-generated try-catch forces the creation of
this extra return. The problem is that we do not want to mark all generated
return with no_warning, because we will miss valid warnings. Not sure yet how
to detect which ones were generated because we naturally reach the end of a
function or they are forced because of compiler-generated code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36254