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/31977] can return OK from "int main()" without a return statement by using a goto before the return



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-05-17 20:45 -------
(In reply to comment #5)
> 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.

C90 is different from both of those and it is just undefined behavior there.


-- 


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


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