home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / std / c / 2586 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.7 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!ucbvax!jit081.enet.dec.com!diamond
  2. From: diamond@jit081.enet.dec.com (08-Sep-1992 0914)
  3. Newsgroups: comp.std.c
  4. Subject: Re: struct hack
  5. Message-ID: <9209080014.AA03467@enet-gw.pa.dec.com>
  6. Date: 8 Sep 92 00:14:51 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 27
  9.  
  10. In article <1992Sep07.104932.20060@x.co.uk> clive@x.co.uk (Clive Feather) writes:
  11. >In article <9209040741.AA16120@enet-gw.pa.dec.com> diamond@jit081.enet.dec.com(04-Sep-1992 1639) writes:
  12. >> You can't go past the end of an array object.  But if malloc() or some other
  13. >> variable has defined the end of the actual array object, then the + operator
  14. >> can get you that far, regardless of the declared type that some other array
  15. >> variable had before getting flattened to a pointer.
  16.  
  17. >But there is an intepretation that says that, given
  18. >    int a [5][5];
  19. >the access "a [1][6]" is illegal, because it goes past the bounds of the
  20. >array "a [1]". In other words, the declared type of the array does
  21. >restrict what can happen to a pointer derived from it.
  22.  
  23. Is that an actual interpretation ruling or was that only someone's posted
  24. opinion on Usenet?  The standard certainly does define [], +, and * in
  25. sufficiently unambiguous terms.
  26.  
  27. If you have the actual texts of the interpretation rulings, would you
  28. please kindly post them?
  29.  
  30. I am also curious as to the "officially" correct thing to do when an
  31. interpretation ruling contradicts the standard (whether correcting an
  32. error that everyone agrees was an error, or otherwise).
  33. --
  34. Norman Diamond       diamond@jit081.enet.dec.com
  35. If this were the company's opinion, I wouldn't be allowed to post it.
  36. "Yeah -- bad wiring.  That was probably it.  Very bad."
  37.