This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: main() in toplev.c
On 07-Jan-2001, Phil Edwards <pedwards@disaster.jaj.com> wrote:
> On Mon, Jan 08, 2001 at 12:55:00PM +1100, Fergus Henderson wrote:
> >
> > Then I could build the gcc
> > back-end as a library.
>
> Well, large parts are already scrunched together as an .a file for
> convenience. I believe toplev.c is already included in that collection.
Sure, I use libbackend.a already. The point is that I want a version
of it that doesn't define main().
> Redefining main() shouldn't be too hard on a language-by-language basis.
I could put
#define main toplev_main
in mercury/lang-options.h, I suppose. Or perhaps in a new file
mercury/lang-main.h. But I think it would be cleaner to avoid `#define main',
by doing it the way I described in my previous mail, with toplev.c defining
toplev_main() and with main() defined in a different file.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.