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: "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: 17 May 2007 17:53:09 -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 #4 from pinskia at gcc dot gnu dot org 2007-05-17 18:53 -------
[pinskia-laptop:~/src] pinskia% gcc -Wreturn-type t.c
t.c: In function 'main':
t.c:15: warning: control reaches end of non-void function
This code is only undefined at runtime which means you cannot error out.
--
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=31977