home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18382 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.6 KB

  1. Path: sparky!uunet!usc!hacgate!SDFSERV!johnl
  2. From: johnl@SDFSERV.hac.com (John Lee)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Version Strings...
  5. Message-ID: <24661@hacgate.SCG.HAC.COM>
  6. Date: 8 Jan 93 20:02:51 GMT
  7. References: <1993Jan8.111612.25180@sunbim.be> <Per_Salmi.0lxs@augs.se>
  8. Sender: news@hacgate.SCG.HAC.COM
  9. Organization: Hughes Aircraft Company, El Segundo, CA
  10. Lines: 30
  11.  
  12. In article <Per_Salmi.0lxs@augs.se> Per_Salmi@augs.se (Per Salmi) writes:
  13. >accs1@bagheera.mumath wrote:
  14. >: In article 93Jan7184001@lk-hp-16.hut.fi, s37732v@snakemail.hut.fi (Markus Juhani Aalto) writes:
  15. >: >In article <Leon.0byx@abcd.Houghton.MI.US> Leon@abcd.Houghton.MI.US (Leon) writes:
  16. >: >UBYTE Version[] = "\0$VER: ProgName 1.0 (7.1.92)";
  17. >:
  18. >: I wonder why that stays in the executable. I would expect a good compiler
  19. >: would 
  20. >: through that line away unless it is really referenced.
  21. >
  22. >You really got a point there! Why does it? 
  23.  
  24. It's externally visible data that might be referenced by a separate
  25. module.  The compiler can't optimize it away because references to it
  26. aren't determined until link-time.  By then, it's too late since the
  27. linker can't throw out things in a module.
  28.  
  29. Now, if it had been declared:
  30.  
  31.     static UBYTE Version[] = "\0$VER: ProgName 1.0 (7.1.92)";
  32.  
  33. then the compiler might have noticed the lack of references and
  34. optimized it away.
  35.  
  36. -------------------------------------------------------------------------------
  37. The crew faces deadly GURUs!  Next time on AmigaDOS: The Next Generation.
  38.     +--------+            John Lee
  39.     | HUGHES |
  40.     +--------+            Internet: jhlee@hac2arpa.hac.com    
  41. The above opinions are those of the user and not of those of this machine.
  42.