This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: pre1.0.2: "warning: control reaches end of non-void function" bug ??
- To: Michael Roth <mroth at arago dot de>
- Subject: Re: pre1.0.2: "warning: control reaches end of non-void function" bug ??
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 03 Mar 1998 21:12:35 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <Pine.LNX.3.91.980304005330.12403A-100000@angstrom.arago.de>
Michael Roth writes:
> Hi,
> when you compile the following programm with gcc you will correctly get two
> warnings about missing return values. But when you compile the same programm
> with c++ or g++ the warning in main() is missing.
> Bug or feature ?
Feature. In C++, falling off the main() function is well-defined, and
is equivalent to `return 0;'
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil