Re: G++/GCC not detetcing stupid errors in code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 22, 2008 at 02:22:49PM +0200, Axel Freyn wrote:
> I would expect that this warning does not exist, because omitting the return-statement in
> "main" is perfectly valid in C++: (C++-Standard, 3.6.1.3)
> "If control reaches the end of main without encountering a return statement, the
> effect is that of executing return 0;"
> 
> For other functions, g++ also emits a warning if you forget the return
> statement.
> 
> Axel

This is something, that while valid by the C++ "Standard", I surely hope
doesn't become common practice.

-cl

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux