static constructors/destructors and atexit

Ulrich Drepper drepper@cygnus.com
Sat Aug 15 00:17:00 GMT 1998


nyap@garban.com (Noel Yap) writes:

> I think the original question was whether the user could write portable
> code (ie code that doesn't assume unlimited atexit() calls).

Not if you want to follow the C++ standard strictly and want to use
lots of global or static objects.

But a few weeks ago I described how I can imagine a better mechanism
to be implemented (better because it's faster and has no such limits)
when you give up 100% standard compliance by not demanding that
user-registered functions (using atexit) run between the destructors
for the object constructed before and after the atexit call.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------



More information about the Gcc mailing list