[Bug c++/36254] wrong "control reaches end of non-void function" warning

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Oct 22 18:21:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list