This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Namespaces & main()
- To: Todd Vierling <tv at pobox dot com>
- Subject: Re: Namespaces & main()
- From: Andreas Schwab <schwab at issan dot informatik dot uni-dortmund dot de>
- Date: 16 Oct 1998 10:38:40 +0200
- Cc: Branko Cibej <branko dot cibej at hermes dot si>, Alexandre Oliva <oliva at dcc dot unicamp dot br>, EGCS List <egcs at cygnus dot com>
- References: <Pine.NEB.4.02.9810151815540.1068-100000@duhnet.net>
Todd Vierling <tv@pobox.com> writes:
|> On Wed, 14 Oct 1998, Branko Cibej wrote:
|>
|> : namespace A { int main() {} }
|>
|> : namespace-main.cc: In function `int main()':
|> : namespace-main.cc:2: warning: control reaches end of non-void function `main()'
|>
|> : int main() {}
|> :
|> : Did not produce a warning. All of this seems OK to me.
|>
|> This part is correct. The global "main" is explicitly defined in the C++
|> standard to return 0 if no return value is given.
Unfortunately g++ doesn't implement that yet. Thus you'll currently get a
random exit code in this case.
Andreas.