🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1065

Re: Bounds checks. (was variable-length struct hack)

#1065
From: Richard H. Gumpertz
Date: Tue, 12 Dec 1989 14:06
17 lines
1676 bytes
In article <1989Dec11.181631.3864@jarvis.csri.toronto.edu> norvell@csri.toronto.edu (Theo Norvell) writes:
>		    int A[N], *p;
>		    for(p=A; p < A+N ; ++p ) { ... } /* Good */
>		    for(p=A; p <  &A[N] ; ++p ) { ... } /* Undefined! */

Gee, that is kind of interesting.  Is the result of &A[N] "used as an
operand of the unary * operator" (which is prohibited in 3.3.6)?  That
is, does the & operator cancel out the * implicit in [...]?  I think some
special language might be required in 3.3.6 to allow &* without
undefined results, since this is probably what the committee desired
anyway.  It would be silly to allow A+N but not &A[N]!

-- 
===============================================================================
| Richard H. Gumpertz rhg%cpsolv@uunet.uu.NET -or- ...uunet!amgraf!cpsolv!rhg |
| Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749      |
===============================================================================
Technical Details
Message-ID: <465@cpsolv.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!kcdev!pars!cpsolv!rhg
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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!kcdev!pars!cpsolv!rhg
From: rhg@cpsolv.UUCP (Richard H. Gumpertz)
Newsgroups: comp.std.c
Subject: Re: Bounds checks.  (was variable-length struct hack)
Message-ID: <465@cpsolv.UUCP>
Date: 12 Dec 89 14:06:39 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>
Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz)
Organization: Computer Problem Solving, Leawood, Kansas
Lines: 17