home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!unix!mxmora
- From: mxmora@unix.SRI.COM (Matt Mora)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: incrementation differences/THINK C 4.0 vs. 5.0
- Message-ID: <38119@unix.SRI.COM>
- Date: 25 Aug 92 16:26:29 GMT
- References: <1992Aug24.223423.24473@kronos.arc.nasa.gov> <1992Aug24.232700.7896@Csli.Stanford.EDU> <BtIJq6.3yw@taligent.com>
- Organization: SRI International, Menlo Park, California
- Lines: 55
-
- In article <BtIJq6.3yw@taligent.com> keith@taligent.com (Keith Rollin) writes:
- >
- >I don't think that's a valid assumption. Although it might be disconcerting, I
- >don't think there's anything preventing a compiler from evaluating your sample
- >line one way during one compile, and the very same compiler evaluating it a
- >different way during a subsequent compile. ANSI spec section 3.3.16 says "The
- >order of evaluation of the operands is unspecified."
-
- Don't you just love C! All the cool things that you can do are the very
- same things you have to worry about. Pretty soon you'll be writing code like
- this just to be safe. i = i + 1; :-)
-
- >On the other hand, if I ever _did_ run across a compiler like that, I'd worry
- >about the brain of the guy who wrote it.
-
- It might act like that if you turn on optimization. It could happen. Yeah and
- monkeys might fly out of my butt.
-
- Why can't there be a smart compiler? Why can't it take a chunk of code
- chew on it all night and in the morning report "After 276 optimitation
- passes I found that moving this varible outside the loop and declaring it as a
- register variable, performance will improve by 56%." And show you the optimized
- SOURCE code.
-
- When a compiler doesn't know the best way to go why doesn't it just ask?
-
- "not sure how you want the order of evaluation of this line:"
- lab[i] = temp[i++]; //****THIS IS THE PROBLEM
-
- "Maybe you mean:"
- lab[i] = temp[i]; i++; //****THIS IS THE PROBLEM
-
- Also why can't the compiler say this when a ";" is missing.
-
- Missing an ";" at the end of this line. Should I add one?"
- "Add one and Continue" or "Cancel"
-
- instead of
-
- "Missing a ";" at the end of statement."
-
- and stop compiling.
-
- Compilers have a long way to go yet. I can't believe that the Mac user
- interface hasn't worked its magic on compiler designers yet.
-
-
-
-
- Matt
- --
- ___________________________________________________________
- Matthew Mora | my Mac Matt_Mora@sri.com
- SRI International | my unix mxmora@unix.sri.com
- ___________________________________________________________
-