This is the mail archive of the
mailing list for the GCC project.
Re: main() in toplev.c
On 07-Jan-2001, Phil Edwards <firstname.lastname@example.org> 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 <email@example.com> | "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.