This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Use of atexit for destructors on Solaris 7.
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: Re: Use of atexit for destructors on Solaris 7.
- From: "Ross Smith" <ross dot s at ihug dot co dot nz>
- Date: Wed, 22 Mar 2000 07:51:55 +1200
- References: <200003211545.KAA19882@jaj.com>
From: "Phil Edwards" <pedwards@jaj.com>
>
> Charles Galambos <c.galambos@eim.surrey.ac.uk>:
> >
> > I've just encountered a problem with the implementation
> > of destructors on Solaris 7. It seems the use the
> > 'atexit' function, this function registers at most 34
> > functions under solaris 7.
>
> Not a bug. The ISO C++ Standard only requires a minimum of 32
functions;
> any implementation that supports more is just being friendly. What's
more,
> the atexit(3c) man page on Solaris 7 documents that "at most 32
functions
> may be registered," so if you're actually seeing 34 functions (I
didn't
> look at your code), then you're actually getting more than what's
required.
That limit applies to atexit() functions, not destructors. The standard
doesn't give an implementation any licence to ignore destructors. If
there is a fixed upper limit on atexit() functions on a system, then it
follows that no compiler on that system is allowed to use atexit() for
destructors.
This may be a big problem for us if it's true. I've been working on a
major project for which Solaris will be one of the targets, and if we
can't get a reliable compiler we're screwed. (Sun's native compiler is a
bad joke.)
I don't currently have a Solaris box to test on, so I can't check
Charles's report. Can anyone confirm or deny it?
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"So that's 2 T-1s and a newsfeed ... would you like clues with that?"
-- Peter Da Silva