This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Use of atexit for destructors on Solaris 7.


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

The problem is that a C++ implementation *has* to register destructors
with atexit, to get the semantics of atexit/destructor interleaving
right.

> 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.)

The problem can be worked-around: Don't use block-local static
variables... Of course, the other proposed work-around (replace atexit
function, have compiler emit a different function call) also work.

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]