This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52003] warning about (un)existing return statement in the main function declared 'noreturn'
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Jan 2012 11:19:02 +0000
- Subject: [Bug c++/52003] warning about (un)existing return statement in the main function declared 'noreturn'
- Auto-submitted: auto-generated
- References: <bug-52003-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52003
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-01-26
Ever Confirmed|0 |1
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-26 11:19:02 UTC ---
(In reply to comment #2)
> main has an implicit return 0 if it follows through to the end according to the
> C++ standard IIRC.
Indeed it does. GCC simply tells you that putting 'noreturn' on main
is not good.
If we don't want this warning maybe the C++ FE should mark that return
stmt with TREE_NO_WARNING and we should honor that flag.