This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __main
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Mike Laman <mlaman at cox dot net>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Sep 2002 02:04:25 +1000
- Subject: Re: __main
- References: <002f01c24f89$6ad6efa0$0a00000a@zarquin> <20020830044008.A479336@murlibobo.cs.mu.OZ.AU> <001e01c24fe4$f4b6e580$5aa80844@fed1.sdca.home.com>
On 29-Aug-2002, Mike Laman <mlaman@cox.net> wrote:
> When running a C cross compiler where one does not want a call
> to "__main()" to be emitted, how can one turn it off?
I don't know off-hand if it can be turned off.
(I doubt if it can, but perhaps with `-ffreestanding'??)
Of course you can always turn it off by modifying the source code!
Probably the easiest solution is to just define a dummy __main()
function that does nothing. You'd better be sure that you don't
link in any C++ programs or libraries, though, because they might
not work properly if constructors for static objects are not
executed.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.