This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __main?
- To: gcc-help at gcc dot gnu dot org
- Subject: Re: __main?
- From: Axel Kittenberger <Anshil at gmx dot net>
- Date: Fri, 26 Jan 2001 11:20:37 +0100 (MET)
- References: <orzogepr5w.fsf@guarana.lsd.ic.unicamp.br>
> 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().
Possibly by -ffreestanding maybe? :o)
> Yep. On certain platforms, GCC arranges for main() to call __main(),
> that runs static initializers.
Okay if I create a __main that's empty the linker will be happy, right?
Hmmm gcc, did not protest when I called main();....
---------------------------------------------
Other question, is gcc capable of letting me switching sections, so like
I've some few global variables that I want to reside in a special section, or
some startup code witch is required to be on the first code page?
All I've found are the macros that allow me to tell gcc how to switch
sections if it decides to do so....
--
Sent through GMX FreeMail - http://www.gmx.net