home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / std / c / 2541 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.6 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!jit081.enet.dec.com!diamond
  2. From: diamond@jit081.enet.dec.com (31-Aug-1992 1441)
  3. Newsgroups: comp.std.c
  4. Subject: Re: void expressions and volatile types
  5. Message-ID: <9208310542.AA02715@enet-gw.pa.dec.com>
  6. Date: 31 Aug 92 05:42:23 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 28
  9.  
  10. In article <BtnI48.D9I@twwells.com> bill@twwells.com (T. William Wells) writes:
  11. >The problem is then what to do with statements like a; and a=b;
  12. >when a is a volatile object. The first expression accesses a but
  13. >then discards the value, which is fine.
  14.  
  15. What constitutes an access is implementation-defined.  A legal but ugly
  16. definition could allow STORING the value of a (redundantly) when the value
  17. is known from some other recent access.
  18.  
  19. >The other does NOT do what you'd expect, though.
  20.  
  21. Who's "you"?  I'd read the implementation's definition in order to see what
  22. to expect.  If I don't like it, I wouldn't buy it.  If I do like it, but
  23. the actual behavior doesn't match the documentation, I'd demand a refund.
  24.  
  25. >The reason is that the assignment has a
  26. >value which is the value of a after the assignment, which can only
  27. >be obtained by accessing a. Thus a=b results in a sequence like:
  28. >       load b
  29. >       store a
  30. >       load a
  31. >rather than the intended load and store.
  32.  
  33. Legal, but (in my personal opinion) ugly.  What does the documentation say?
  34. --
  35. Norman Diamond       diamond@jit081.enet.dec.com
  36. If this were the company's opinion, I wouldn't be allowed to post it.
  37. "Yeah -- bad wiring.  That was probably it.  Very bad."
  38.