Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!amgraf!cpsolv!rhg From: rhg@cpsolv.UUCP (Richard H. Gumpertz) Newsgroups: comp.std.c Subject: Re: Bounds checks. (was variable-length struct hack) Message-ID: <466@cpsolv.UUCP> Date: 13 Dec 89 15:28:22 GMT References: <448@longway.TIC.COM> <450@longway.TIC.COM> <15364@haddock.ima.isc.com> <809@prles2.UUCP> <1989Dec8.161820.24804@jarvis.csri.toronto.edu> <1989Dec11.181631.3864@jarvis.csri.toronto.edu> <1989Dec12.190347.13521@twwells.com> Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz) Organization: Computer Problem Solving, Leawood, Kansas Lines: 18 In article <1989Dec12.190347.13521@twwells.com> bill@twwells.com (T. William Wells) writes: >The two are exactly the same: > > &A[N] = &(*(A + N)) = A + N No, the two are not exactly alike. According to 3.3.6, *(A+N) is undefined ("...the behavior is undefined if the result is used as an operand of a unary * operator") and so &(*(A+N)) is undefined. A+N, on the other hand, is well defined. I really believe that the wording in 3.3.6 is wrong; I cannot believe that the committee intended for A+N to be legal but not &A[N]. Anyone on the committee care to respond? -- =============================================================================== | Richard H. Gumpertz rhg%cpsolv@uunet.uu.NET -or- ...uunet!amgraf!cpsolv!rhg | | Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 | ===============================================================================