This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add --enable-__cxa_atexit
- From: Zack Weinberg <zack at codesourcery dot com>
- To: "H . J . Lu" <hjl at lucon dot org>
- Cc: Jack Howarth <howarth at nitro dot msbb dot uc dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 May 2002 11:21:18 -0700
- Subject: Re: PATCH: Add --enable-__cxa_atexit
- References: <200205310627.CAA13821@nitro.msbb.uc.edu> <200205311604.MAA14609@nitro.msbb.uc.edu> <20020531104311.A25686@lucon.org>
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.
2) No comma after "than".
3) Call the macro DEFAULT_USE_CXA_ATEXIT.
> +#ifdef ENABLE_CXA_ATEXIT
> +int flag_use_cxa_atexit = 1;
> +#else
> int flag_use_cxa_atexit;
> +#endif
Undesirable use of #ifdef. Put
#ifndef DEFAULT_USE_CXA_ATEXIT
#define DEFAULT_USE_CXA_ATEXIT 0
#endif
in defaults.h, then write
int flag_use_cxa_atexit = DEFAULT_USE_CXA_ATEXIT;
in decl2.c.
zw