This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static constructors/destructors and atexit
- To: Todd Vierling <tv at pobox dot com>
- Subject: Re: static constructors/destructors and atexit
- From: Noel Yap <nyap at garban dot com>
- Date: Wed, 12 Aug 1998 07:35:37 -0400
- CC: Steven Parkes <parkes at sierravista dot com>, Alexandre Oliva <oliva at dcc dot unicamp dot br>, egcs at cygnus dot com
- Organization: Garban LLC
- References: <Pine.NEB.4.02.9808111243120.18623-100000@duhnet.net>
Todd Vierling wrote:
>
> On Mon, 10 Aug 1998, Steven Parkes wrote:
>
> : so the idea is use gcc's atexit on systems that implement limited atexits?
>
> I liked the earlier idea of a specialized atexit() for this purpose. If,
> for example, a small version of atexit() designed for the job were put in
> libgcc2, who calls the real atexit() only once, you could use it on all
> systems (not just those with "broken atexit()s"). Something with a name
> like __dtoratexit() or similar.
Yes, since the spec states that an implementation could have a limit to
the number of called functions, I wrote my own. The atexit__set()
function calls atexit() once and keeps track of the registered
function. The only problem (which is not insurmountable) would be to
get everyone to use this new function.
Noel