This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] to gcc: use xexit/xatexit in fixinc
- To: law at redhat dot com
- Subject: Re: [patch] to gcc: use xexit/xatexit in fixinc
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 01 Jan 2001 23:00:24 -0200
- Cc: Bruce Korb <bkorb at cruzio dot com>, Michael Sokolov <msokolov at ivan dot Harhan dot ORG>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <16612.978127382@upchuck>
On Dec 29, 2000, Jeffrey A Law <law@redhat.com> wrote:
> Note that on these ancient systems, we call __main before we call main
> which would allow us to do something similar.
Isn't it main() that calls __main()? In this case, there'd be no way
to intercept returning from main(). Besides, we can't expect to have
any help from the bootstrap compiler. So we really have to change
programs in GCC so that they don't depend on exit()/atexit() on
platforms that don't offer the latter, and we need our own
work-around. The unfortunate thing is that, since there aren't that
many systems out there that don't offer atexit(), the fallback won't
be tested as much. Makes me wonder whether we shouldn't just switch
to xatexit()/xexit() on *all* systems, so that we get the same exit
code exercised on all platforms. It's not like it would be a
performance or an additional maintenance burden (unless we were to
decide to stop supporting platforms without atexit(), which I believe
is not the case), and we wouldn't be subject to arbitrary limits
imposed by the built-in implementations. How does this sound?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me