This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Namespaces & main()
- To: Gerald Gutierrez <gutier at intergate dot bc dot ca>
- Subject: Re: Namespaces & main()
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 12 Oct 1998 00:13:37 -200
- Cc: EGCS List <egcs at cygnus dot com>
- References: <36200B1C.38A4D295@intergate.bc.ca>
Gerald Gutierrez <gutier@intergate.bc.ca> writes:
> namespace A { void main () { } }
> namespace B { void main () { } }
> /tmp/ccNoTIxu.s: Assembler messages:
> /tmp/ccNoTIxu.s:27: Fatal error: Symbol main already defined.
> Is this correct C++ behaviour or is this something wrong with egcs ?
It's a bug in egcs. main() is only reserved in the global namespace,
according to [basic.start.main]/3. I've installed your testcase in
the testsuite.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil