This is the mail archive of the gcc-bugs@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: Use of atexit for destructors on Solaris 7.


> To: gcc-bugs@gcc.gnu.org
> Date: Wed, 22 Mar 2000 10:17:47 +0000
> From: Charles Galambos <c.galambos@eim.surrey.ac.uk>

> Since 'atexit' on solaris is function ptr it can be replaced. (Is
> this part of the standard ??)

Nope.

> Is there a way I can replace the atexit function before or at least
> early in the initilisation of static variables ?

Yes, if you put it in the right place on the link line, in a
constructor, you have have it run early.

> It would have been good also if failure of the atexit function
> wasn't silently ignored, especailly as most implementations seem to
> have a limit of the the number of times it can be called.

Yes, xatexit (f) { if (atexit (f) == FAILURE) throw out_of_memory; }
or something like this seems the most logical.

libgcc2 should do this for us, as we never check it in the generated
code.

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