This is the mail archive of the gcc@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: Namespaces & main()


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.


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