home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16180 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.1 KB

  1. Path: sparky!uunet!know!mips2!news.bbn.com!noc.near.net!hri.com!spool.mu.edu!news.cs.indiana.edu!umn.edu!csus.edu!netcom.com!knee
  2. From: knee@netcom.com (Mark Lanett)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: MPW C++ bug?
  5. Message-ID: <1992Nov12.224642.839@netcom.com>
  6. Date: 12 Nov 92 22:46:42 GMT
  7. References: <BxKz81.8C5@vcd.hp.com>
  8. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  9. Lines: 19
  10.  
  11. John Matthews <jm@vcd.hp.com> writes:
  12.  
  13. >I seem to have run into a possible bug between the C++ compiler and the
  14. >MPW linker.
  15. >The problem concerns statically (globally) allocated objects with
  16. >constructors.
  17. >If the global object is not referenced anywhere else in the program, but
  18. >does have
  19. >a constructor that causes side-effects, I believe the semantics of C++
  20. >states that
  21. >that object must be constructed.
  22.  
  23. >However, since the linker notices that no-one is actually using the
  24. >global variable,
  25. >it strips out the object, along with its constructor call, from the
  26. >program.
  27.  
  28. Apple introduced that bug *on purpose*, to help the linker do dead stripping.
  29. The -z5 option stops it. I know it's mentioned in the release notes, BTW.
  30.