__cxa_atexit question

Mark Mitchell mark@codesourcery.com
Sun May 14 20:29:00 GMT 2006


Steve Ellcey wrote:
>>> No, I was thinking of putting actual definitions of __cxa_atexit and
>>> __cxa_finalize (and atexit) in libstdc++.
>> I don't think atexit is appropriate. However, the other two seem like
>> candidates. Without the atexit hooks seems kinda pointless tho.
> 
> Yes, without atexit I think it is pointless.  I will probably not follow
> up on this.

I think it's reasonable to conditionally include a C++-aware atexit,
__cxa_atexit, and __cxa_finalize in libsupc++, which is then
incorporated into libstdc++.  On a system where these functions are not
in the C library, there's no other way to build a conforming C++
implementation.  Other C++ compilers provide their own runtime libraries
on such platforms, so as to conform to the C++ standard; why shouldn't
we do the same?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Libstdc++ mailing list