This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __main


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]