This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53232] No warning for main() without a return statement with -std=c99
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 May 2012 15:44:04 +0000
- Subject: [Bug c/53232] No warning for main() without a return statement with -std=c99
- Auto-submitted: auto-generated
- References: <bug-53232-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53232
--- Comment #5 from Vincent LefÃvre <vincent-gcc at vinc17 dot net> 2012-05-04 15:44:04 UTC ---
(In reply to comment #4)
> IMHO this isn't a bug because in C99 it's well-defined what happens if you fall
> off the end of main,
Only at program termination (if my interpretation of C99 is correct). Please
read again the bug report and the links.
> so it would annoy people to issue a warning on perfectly valid code
> whenever -Wall is enabled.
Well, GCC has various warnings on perfectly valid code, just because the code
is suspicious. This is the case here too. And there are potential portability
problems (not everyone may use a C99 compiler). So, good reasons to issue a
warning.