home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / folklore / computer / 16698 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  1.3 KB

  1. Path: sparky!uunet!news.centerline.com!jimf
  2. From: jimf@centerline.com (Jim Frost)
  3. Newsgroups: alt.folklore.computers
  4. Subject: Re: Computer Superstition
  5. Date: 24 Nov 1992 01:53:04 GMT
  6. Organization: CenterLine Software, Inc.
  7. Lines: 26
  8. Message-ID: <1es1u0INN7ef@armory.centerline.com>
  9. References: <10292323.7317.11306@kcbbs.gen.nz> <1992Nov18.124517@frej.teknikum.uu.se> <1992Nov20.015335.19860@fcom.cc.utah.edu> <aldavi01.722544719@starbase.spd.louisville.edu>
  10. NNTP-Posting-Host: 140.239.3.202
  11.  
  12. aldavi01@terra.spd.louisville.edu (Arlie Davis) writes:
  13. >Yes, but the latest, greatest super-swanky optimizing compiler may realize
  14. >that only the first two elements in the array are being used.  So, you have to
  15. >use the more exotic form:
  16.  
  17. >    char magic[12];
  18. >    magic[0] = magic[11];
  19.  
  20. >And if a compiler can squeeze /that/ down, well, I give up.
  21.  
  22. Even a moderately good optimizing compiler will notice that the above
  23. assignment has no effect and will eliminate the assignment and the
  24. array.
  25.  
  26. I'd use one of three fixes:
  27.  
  28. 1. Don't optimize that file.
  29. 2. Write the caller in assembly.
  30. 3. Rewrite the #@%$# routine so it doesn't corrupt the stack in the
  31.    first place.
  32.  
  33. Personally I'd probably pick #3 because I have implementations of
  34. system() lying around, but your mileage may vary.
  35.  
  36. jim frost
  37. jimf@centerline.com
  38.