Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!cit-vax!usc-oberon!castor.usc.edu!blarson From: blarson@castor.usc.edu.UUCP Newsgroups: comp.lang.c Subject: evaluation order, unary +, etc. Message-ID: <1557@castor.usc.edu> Date: Sat, 11-Apr-87 22:06:04 EST Article-I.D.: castor.1557 Posted: Sat Apr 11 22:06:04 1987 Date-Received: Sun, 12-Apr-87 17:37:58 EST Reply-To: blarson@castor.usc.edu.UUCP (Bob Larson) Distribution: world Organization: USC AIS, Los Angeles Lines: 30 When I use parentheies in an expression, I do so for readability of code and/or override operator presidence, NOT to force the calculation to be done in that order. Changing the meaning of parenthesies in C would force me as a programer to write less readable code so the optimizer could do it's job. I do think having a way to force evalution order is not a bad idea, and I'm not especially in love with the use of unary plus for it. A cast to volitile would be much better, it's saying what you mean. double a,b,c,d; a = (volitile double)(b + c) + d; would mean calculate b+c before adding d. If I was serious about proposing changes to C, I would probably propose that the whole float/double portion be made optional. I rarly find them of any use, and can't justify having compiler/library writers waste time on them. (I am a full time programer, and can't remember the last time I needed to to something in floating point.) (OK, I admit this paragraph was added to show that not everyone uses C for the same thing. I think forcing parathasies to mean something different than they currently do is just as bad for me as eliminating floating point would be for you.) -- Bob Larson Arpa: Blarson@Usc-Eclb.Arpa Uucp: (several backbone sites)!sdcrdcf!usc-oberon!castor.usc.edu!blarson seismo!cit-vax!usc-oberon!castor.usc.edu!blarson