This is the mail archive of the gcc-patches@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]

Re: [patch] to gcc: use xexit/xatexit in fixinc


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

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