This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PATCH: Add --enable-__cxa_atexit


On Fri, May 31, 2002 at 11:44:17AM -0700, H . J . Lu wrote:
> On Fri, May 31, 2002 at 11:21:18AM -0700, Zack Weinberg wrote:
> > On Fri, May 31, 2002 at 10:43:11AM -0700, H . J . Lu wrote:
> > > +# Enable __cxa_atexit for C++.
> > > +AC_ARG_ENABLE(__cxa_atexit,
> > > +[  --enable-__cxa_atexit   enable __cxa_atexit for C++],
> > > +[], [enable___cxa_atexit=no])
> > > +if test x$enable___cxa_atexit != xno; then
> > > +  AC_DEFINE(ENABLE_CXA_ATEXIT, 1,
> > > +  [Define if you want to use __cxa_atexit, rather than, atexit to
> > > +   register C++ destructors for local statics and global objects.])
> > > +fi
> > 
> > 1) Why is this an --enable switch rather than a tm.h #define?  This is
> >    the major concern with the patch.
> 
> There is no way to reliably check if target's __cxa_atexit is available
> and correct. Think about cross compiler. I couldn't even figure out
> a clean way to check if it is available for cross compiler. I don't
> want to enable it for Linux by default since it is a relatively new
> feature in glibc.

Fair enough.  In that case, you need to document the switch in
install.texi.

> +  [Define if you want to use __cxa_atexit, rather than atexit to
> +   register C++ destructors for local statics and global objects.])

I missed this before - you need a comma after atexit:

   Define if you want to use __cxa_atexit, rather than atexit, to

> +/* Determine if __cxa_atexit, rather than atexit is used to register
> +   C++ destructors for local statics and global objects. */

Here too.  Also, use "whether" not "if".

zw


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