home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18295 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  1.5 KB

  1. Path: sparky!uunet!sdrc!thor!scjones
  2. From: scjones@thor.sdrc.com (Larry Jones)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question to test general C knowledge
  5. Message-ID: <2391@sdrc.COM>
  6. Date: 13 Dec 92 19:19:08 GMT
  7. References: <19980@ksr.com> <PTmLVB4w165w@quest.UUCP> <1992Dec13.045828.1714@crd.ge.com>
  8. Sender: news@sdrc.COM
  9. Lines: 22
  10.  
  11. In article <1992Dec13.045828.1714@crd.ge.com>, volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe) writes:
  12. > You miss the point. One of them will happen first. Does the second
  13. > one constitute a modification? Look at it this way: When the "++" operator
  14. > is evaluated, the machine throws a card up in the air with the words
  15. > "put 3 in i" on it. That's the side effect associated with the "++" operator.
  16.  
  17. The specifications in the C Standard give the machine the right to use a
  18. card that says "increment i" instead, which is where the indeterminancy
  19. and thus undefinedness come from.
  20.  
  21. > A clearer example illustrating the issue I raise would be the following:
  22. >     i = (i = 4)
  23.  
  24. That's a more interesting question.  My interpretation is that "modify"
  25. is used in the standard in a generic sense of "replacing the current
  26. value".  In this sense, "i = 4" modifies i, even if the current value of
  27. i happens to be 4, because it's storing a "different" 4 into it.  So, I
  28. would still call it undefined.
  29. ----
  30. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  31. larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
  32. I've got more brains than I know what to do with. -- Calvin
  33.