Namespaces & main()

Todd Vierling tv@pobox.com
Thu Oct 15 18:57:00 GMT 1998


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.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)




More information about the Gcc mailing list