Use of atexit for destructors on Solaris 7.

Phil Edwards pedwards@jaj.com
Tue Mar 21 14:01:00 GMT 2000


Ross Smith writes:
> 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.

Ah, I see the problem now.  As Mike Stump says, compilers will have
limits, but I didn't think this was one of them for gcc.  I suppose
the installation could grab ATEXIT_MAX out of <limits.h> and write out
atexit() if the number is less than some threshold value (1024?).


> 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?

I confirm it.  Solaris 7, gcc 2.95.2.  Bummer.


Phil



More information about the Gcc-bugs mailing list