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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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-09 10:40:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsfeed0.news.atl.earthlink.net!news.atl.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Commercial C To Ada 95 compiler Date: Sun, 09 Jun 2002 10:41:38 -0700 Organization: AdaWorks Software Engineering Message-ID: <3D039352.779DFE8E@adaworks.com> References: <3D002D11.CC706952@adaworks.com> <4519e058.0206071148.9b87acf@posting.google.com> <3D0116F3.7254E263@despammed.com> <3D018106.6080004@worldnet.att.net> <3D022877.B3B5CD3A@adaworks.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.41.a3 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 9 Jun 2002 17:39:03 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:25606 Date: 2002-06-09T17:39:03+00:00 List-Id: Pascal Obry wrote: > Richard Riehle writes: > > > Actually, note that the following program that indexes off the end > > of an array will compile in Ada. > > No it does not, there is nothing into the loop. OK. Replace the null statement with The_Vector(I) := 0; This will still compile. The point is that someone said this kind of thing would be rejected as an error by an Ada compiler. It is not rejected by every compiler, even though some compilers might provide a warning. I agree with the comment that it will be caught at run-time. No argument that the outcome is better than one might expect from a C program. However, the assertion that the compiler will detect it is wrong, even when you add code to manipulate the content of the array and not just the index. Richard Riehle