Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: comp.sys.amiga Subject: Re: Cause() problem solved. Message-ID: <5162@well.UUCP> Date: 5 Feb 88 23:58:03 GMT References: <699@trwspf.TRW.COM> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Distribution: na Organization: Me? Organized? Get real! Lines: 48 Summary: Mindless compiler flamage ahead; hit 'n' now if you like. In article <699@trwspf.TRW.COM> knurlin@trwspf.UUCP (Scott Karlin) writes: >(2) the compiler was too smart <-- [ you call this smart? ] >for my own good (the compiler saw that abort was >always 0 so it didn't bother to test it each time >through the loop). > > >#include >#include >#include > >int abort; > >/* Compile with Lattice 4.0 using -y -v options */ > ActivateFlame (PLAYFUL_MODE); My opinion of the Lattice compiler falls by the microsecond, John Toebes' extreme talent notwithstanding. If Lattice was really concerned about making good compilers, this "optimization" would not be a default. Look at your Friendly Neighborhood UNIX System sometime, and check the man page for 'cc'. They all seem to have the flag: -O It means to attempt code optimization. It is not the default. If you don't supply the flag, the compiler plays dumb, and compiles the code you wrote. I'm always quietly amused when I hear about dim-witted compilers making a move like this. "Gee! I'm just SOOOO smart! I think I'll optimize this test away, since that's what the programmer must REALLY want. After all, what does THAT programmer know? Gosh, I SOOO proud of myself! I think I'll go off and optimize all his 'printf' statements and substitute the print functions that he really MEANT to call behind his back!...." InactiveFlame (); Actually, I suppose this is why dpANS thought up the 'volatile' keyword, which probably should have been used in Scott's program. Does Lattice 4.0 support that one? _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ \_ -_ Recumbent Bikes: dual ---> !{well,unicom}!ewhac O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack") "Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor