From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32cfbb718858528b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-12 08:42:57 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!cox.net!news-east.rr.com!cyclone.columbus.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3D076BFC.92A8F9C5@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Commercial C To Ada 95 compiler References: <3D002D11.CC706952@adaworks.com> <4519e058.0206071148.9b87acf@posting.google.com> <3D0116F3.7254E263@despammed.com> <3D018106.6080004@worldnet.att.net> <3D022877.B3B5CD3A@adaworks.com> <3D053737.476B8185@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 12 Jun 2002 15:42:26 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1023896546 66.75.151.160 (Wed, 12 Jun 2002 08:42:26 PDT) NNTP-Posting-Date: Wed, 12 Jun 2002 08:42:26 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25800 Date: 2002-06-12T15:42:26+00:00 List-Id: Marin David Condic wrote: > > Unless my intent was to figure out the address of the thing located just > after X - probably Y in this case. You're allowed to go one past the end in either direction. You're not allowed to go two past the end. > The thing is that it isn't really an > error until you are trying to de-reference the thing pointed to by Y. This is what I'm saying. No, that's theoretically incorrect. It *is* an error even if you don't try to dereference the thing pointed to by Y. Simply doing the arithmetic on Y is in theory erroneous. > Before > that its just incrementing a counter - which might be done for all sorts of > reasons none of which may have anything to do with the array X. Well, no, it's incrementing a pointer into the array X. If you were talking about using array subscripting, that would be true. But if you're talking about incrementing pointers rather than integers, the hardware is allowed to enforce (for example) segments of exactly the right size, such that a pointer to one chunk of memory is not allowed to point to a different chunk of memory via incrementing. > particular case might come under the heading of "No Harm - No Foul" - It may > be an error in the code, but one that has no impact on the correct operation > of the program. Until you port it to a machine that actually checks it, or to a C compiler or interpreter that actually implements the range checks it's allowed to implement. My point is that the C standard says you're *allowed* to implement range checking on arrays. In practice, very few do, and in my experience, those that do are specifically low-performance debugging type interpreters. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. ** http://home.san.rr.com/dnew/DNResume.html ** ** http://images.fbrtech.com/dnew/ ** My brain needs a "back" button so I can remember where I left my coffee mug.