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]

Re: pre1.0.2: "warning: control reaches end of non-void function" bug ??


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


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