home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / bugs / 65 < prev    next >
Encoding:
Text File  |  1993-01-04  |  943 b   |  41 lines

  1. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!hzatz
  2. From: hzatz@cco.caltech.edu (Harold Zatz)
  3. Newsgroups: comp.sys.sgi.bugs
  4. Subject: C++ atexit() doesn't work
  5. Date: 4 Jan 1993 22:17:25 GMT
  6. Organization: Rhythm & Hues, Inc.
  7. Lines: 28
  8. Sender: Harold Zatz (hzatz@rhythm.com)
  9. Distribution: world
  10. Message-ID: <1iad1lINNnn7@gap.caltech.edu>
  11. NNTP-Posting-Host: alumni.caltech.edu
  12.  
  13. On an Elan R4000, running 4.0.5F, with a version of the C++ library
  14. that looks like:
  15. krazy % ll /usr/lib/libC.a
  16. -r--r--r--   1 root     wheel     161188 Oct  2 19:48 /usr/lib/libC.a
  17.  
  18. atexit() doesn't work with C++. Try this program:
  19. -----test.c-----
  20. #include <stdlib.h>
  21. #include <stdio.h>
  22.  
  23. void doMe() {
  24.     fprintf( stderr, "atexit() works!\n" );
  25.     }
  26.  
  27. main() {
  28.     atexit( doMe );
  29.     exit( 0 );
  30.     }
  31. -------
  32. krazy % cc -o test test.c
  33. krazy % test
  34. atexit() works!
  35. krazy % CC -o test test.c
  36. krazy % test
  37.  
  38.     Fixes? Workarounds? Anyone?
  39.  
  40.     --Harold Zatz
  41.