home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.centerline.com!jimf
- From: jimf@centerline.com (Jim Frost)
- Newsgroups: alt.folklore.computers
- Subject: Re: Computer Superstition
- Date: 24 Nov 1992 01:53:04 GMT
- Organization: CenterLine Software, Inc.
- Lines: 26
- Message-ID: <1es1u0INN7ef@armory.centerline.com>
- 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>
- NNTP-Posting-Host: 140.239.3.202
-
- aldavi01@terra.spd.louisville.edu (Arlie Davis) writes:
- >Yes, but the latest, greatest super-swanky optimizing compiler may realize
- >that only the first two elements in the array are being used. So, you have to
- >use the more exotic form:
-
- > char magic[12];
- > magic[0] = magic[11];
-
- >And if a compiler can squeeze /that/ down, well, I give up.
-
- Even a moderately good optimizing compiler will notice that the above
- assignment has no effect and will eliminate the assignment and the
- array.
-
- I'd use one of three fixes:
-
- 1. Don't optimize that file.
- 2. Write the caller in assembly.
- 3. Rewrite the #@%$# routine so it doesn't corrupt the stack in the
- first place.
-
- Personally I'd probably pick #3 because I have implementations of
- system() lying around, but your mileage may vary.
-
- jim frost
- jimf@centerline.com
-