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


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