atexit bug?

Ben Elliston
Wed Sep 10 10:27:00 GMT 2003

In libc/stdlib/exit.c (_DEFUN), I see:

  register struct _atexit *p;
  register struct _on_exit_args * args;
  register int n;
  int i;

  p = &_GLOBAL_REENT->_atexit;

I think this might have problems.  When REENT_SMALL is defined,
_reent::_atexit (using C++ scoping notation) is a struct _atexit
member, whereas when it is not defined, it is a pointer to a struct
_atexit meaning that _GLOBAL_REENT->_atexit's type changes depending
on the state of REENT_SMALL.

Is my understanding correct?


More information about the Newlib mailing list