Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!uw-beaver!milton!ogicse!intelhf!ichips!iwarp.intel.com!inews!pima!bhoughto From: bhoughto@pima.intel.com (Blair P. Houghton) Newsgroups: comp.std.c Subject: Re: ++i++ in Plain English Message-ID: <3924@inews.intel.com> Date: 20 Apr 91 01:34:15 GMT Article-I.D.: inews.3924 References: <5ywa15w164w@cellar.UUCP> <3845@inews.intel.com> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 23 In article peter@ficc.ferranti.com (Peter da Silva) writes: >In article <3845@inews.intel.com> bhoughto@hopi.intel.com (Blair P. Houghton) writes: >> Yes, you're right, most of it is moot, but remember that >> the entire operation is permitted to be "discarded" if > > ... and if i isn't volatile ... Nope. A volatile declaration implies only that a side effect occurs whenever the variable is named (accessed) whether you're reading or writing it (i.e., whether it's in an rvalue or lvalue context). If the compiler's smart enough to understand that the "side effect is not needed" (q.v., somewhere in ANSI X3.159-1989; you can use the rest of the book to define what "needed" means) and the value is not used, then the evaluation can be elided. It'd have to be a pretty dang smart compiler, though... --Blair "If you can detect no difference, then there is no difference." - Houghton's Indeterminacy Corollary to Heisenberg's Uncertainty Principle