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/53232] No warning for main() without a return statement with -std=c99


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.


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