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-08 08:58:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Commercial C To Ada 95 compiler Date: Sat, 8 Jun 2002 15:58:03 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3D002D11.CC706952@adaworks.com> <4519e058.0206071148.9b87acf@posting.google.com> <3D0116F3.7254E263@despammed.com> <3D018106.6080004@worldnet.att.net> <3D022877.B3B5CD3A@adaworks.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1023551883 20128 129.241.83.82 (8 Jun 2002 15:58:03 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Sat, 8 Jun 2002 15:58:03 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:25542 Date: 2002-06-08T15:58:03+00:00 List-Id: On Sat, 08 Jun 2002 08:53:28 -0700, Richard Riehle wrote: > Jim Rogers wrote: > >> One simple example is indexing past the end of an array. >> C compilers simply will not catch this problem. Ada compilers will. > > Actually, note that the following program that indexes off the end > of an array will compile in Ada. > > procedure Index_Past_The_End is > type Vector is array(Positive range <>) of Integer; > The_Vector : Vector (1..100) := (others => 0); > begin > for I in The_Vector'First .. The_Vector'Last + 1 > loop > null; > end loop; > end Index_Past_The_End; Yes, however the Ada program will end with an exception at run-time. With the C program anything could happen, even a reboot I guess. Preben