static constructors/destructors and atexit

Mike Stump mrs@wrs.com
Mon Aug 10 09:30:00 GMT 1998


> To: egcs@cygnus.com
> Date: Sun, 09 Aug 1998 14:03:11 -0700
> From: Steven Parkes <parkes@sierravista.com>

> The C++ front end is using atexit() to schedule destruction of static
> local objects.

Right.

> However, a conforming atexit() implementation need only handle 32
> atexit() calls.

2 The limits may constrain quantities that include those described below
  or   others.    The   bracketed  number  following  each  quantity  is
  recommended  as  the  minimum  for  that  quantity.   However,   these
  quantities are only guidelines and do not determine compliance.

  - Functions registered by  atexit()[32].

So, it is conforming if you one have only one, and document it.

> We've hit this limit.

gcc should reimplement atexit for you, and provide it when the system
atexit is so limited, it doesn't do this yet.

> Could the scheduling of these functions be done some other way?

Nope.



More information about the Gcc mailing list