What prototype for atexit()?

Jeff Johnson jbj@jbj.org
Sun Feb 8 07:56:00 GMT 1998


Greetings --

This is a teensy but annoying problem. Compiling egcs on multiple platforms
from a simgle src tree often craps out with a prototype clash for atexit. Why
have two conflicting prototypes? One of the two is guaranteed to be wrong
everywhere ...

Anyways, from my very limited view point, I suggest

Index: gbl-ctors.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gbl-ctors.h,v
retrieving revision 1.1.1.1
diff -u -c -r1.1.1.1 gbl-ctors.h
*** gbl-ctors.h	1997/08/11 15:57:07	1.1.1.1
--- gbl-ctors.h	1998/02/08 15:48:23
***************
*** 40,46 ****
  #if defined (WINNT) || defined (NEED_ATEXIT)
  extern int atexit (void (*) (void));
  #else
! extern void atexit (void (*) (void));
  #endif
  #define ON_EXIT(FUNC,ARG) atexit ((FUNC))
  #else
--- 40,46 ----
  #if defined (WINNT) || defined (NEED_ATEXIT)
  extern int atexit (void (*) (void));
  #else
! /* extern void atexit (void (*) (void)); */
  #endif
  #define ON_EXIT(FUNC,ARG) atexit ((FUNC))
  #else

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@jbj.org
Gaithersburg, MD



More information about the Gcc mailing list