This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33425] GCC Compiles C++ program containing value-returning functions that don't return a value
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2007 23:51:01 -0000
- Subject: [Bug c++/33425] GCC Compiles C++ program containing value-returning functions that don't return a value
- References: <bug-33425-15094@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-09-13 23:51 -------
That book is wrong when it comes to the standard.
The standard says (6.6.2/2, last sentence):
Flowing off the end of a function is equivalent to a return with no value; this
results in ___undefined behavior___ in a value returning function.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33425