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++/43943] "warning: no return statement in function returning non-void" should be an error



------- Comment #5 from redi at gcc dot gnu dot org  2010-04-30 11:26 -------
The point being that it's undefined behaviour to /return/ from such a function,
not to /write/ such a function.

If the programmer guarantees the "missing return" will never happen then
there's no error.

I was wrong to say it's OK as long as the caller doesn't use the return value -
but it is OK as long as control never reaches the "missing return"


-- 


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


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