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-10 01:09:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!transit.news.xs4all.nl!not-for-mail From: Fraser Wilson Newsgroups: comp.lang.ada Subject: Re: Commercial C To Ada 95 compiler Date: 10 Jun 2002 10:11:11 +0200 Organization: XS4ALL Internet BV Sender: fwilson@FWILSON 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> <3D039352.779DFE8E@adaworks.com> NNTP-Posting-Host: a80-126-24-12.adsl.xs4all.nl X-Trace: news1.xs4all.nl 1023696579 1829 80.126.24.12 (10 Jun 2002 08:09:39 GMT) X-Complaints-To: abuse@xs4all.nl NNTP-Posting-Date: 10 Jun 2002 08:09:39 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:25654 Date: 2002-06-10T08:09:39+00:00 List-Id: Richard Riehle writes: > 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. True. On the other hand, everybody iterates through arrays with a for loop over the range, an option not available in C. I think this is idiom one of the key wins for Ada: no range checking required, no performance penalty, and no chance of a run time exception. I expect that detecting this as a special case in a C to Ada compiler would not be excessively difficult, assuming the array bounds were available somewhere (though recognising the extra length argument to an array handling function would be tricky). cheers, Fraser.