__main?
Alexandre Oliva
aoliva@redhat.com
Fri Jan 26 02:02:00 GMT 2001
On Jan 26, 2001, Axel Kittenberger <Anshil@gmx.net> wrote:
> Unfortunally one of my routines is called "main", and somehow gcc seems to
> handle that one specially :), however in my case this just a function like
> every one else.
How is GCC supposed to figure it out? main() *is* a special function
in C. You aren't even allowed to take its address or to call it.
Don't name a regular function main().
> To be exact, after compiling that file containing the main function
> it stops at linking stage with an unresolved link to "__main".
> [...] Did gcc create that? or what is it?
Yep. On certain platforms, GCC arranges for main() to call __main(),
that runs static initializers.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Gcc-help
mailing list