This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31977] can return OK from "int main()" without a return statement by using a goto before the return
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2007 19:38:43 -0000
- Subject: [Bug c/31977] can return OK from "int main()" without a return statement by using a goto before the return
- References: <bug-31977-14564@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from bangerth at dealii dot org 2007-05-17 20:38 -------
Both the C99 standard (section 5.1.2.2.3) and the C++ standard (3.6.1/5)
say that if you hit the end of the main() function, then this is equivalent
to a "return 0;" statement.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31977