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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Tero Koskinen Newsgroups: comp.lang.ada Subject: Re: Position of "use" Date: Thu, 10 Jul 2014 20:47:35 +0300 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <33fbd821-cb30-4be9-93c1-17002470413e@googlegroups.com> NNTP-Posting-Host: 188-67-162-251.bb.dnainternet.fi Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: loke.gir.dk 1405014458 2790 188.67.162.251 (10 Jul 2014 17:47:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 10 Jul 2014 17:47:38 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-Enigmail-Version: 1.6 Xref: news.eternal-september.org comp.lang.ada:20843 Date: 2014-07-10T20:47:35+03:00 List-Id: 10.7.2014 18:57, Adam Beneschan wrote: > GNAT lets things slip through that should be errors. To GNAT's defence, this kind of bugs are pretty hard to find, especially afterwards if enough care has not been taken during the initial implementation. Many times you only notice "accepts invalid code" bug if another compiler rejects the code.[1] Some of my recent examples: 1) GNAT compiles Strings Edit 2.9 cleanly, while ICCAda rejects the code: > > "strings_edit-integers-subscript.ads", line 31: Error: Undefined > identifier: > > Number. [RM 4.1(11), 8.3, 8.6(28)] > (See http://build.ada-language.com/job/Strings_Edit_ICCAda/3/console for full log.) 2) ICCAda and GNAT both compile Debug package from Adalog ( http://www.adalog.fr/compo2.htm#Debug ) while Janus/Ada rejects the code: > In File C:\work\adalog-debug\DEBUG.ADS at line 206 > -------------- > 205: type Debug_String is new String; > 206: procedure Free is new Ada.Unchecked_Deallocation > (Debug_String, Debug_String_Access); >-------------------------------------------------------------------------^ > *ERROR* Formal and actual must both be constrained or unconstrained > (6.4.10) [RM 12.5.4(3)] Of course, in these cases, one could probably argue which compilers are correct and which are not; luckily I a user, who does not need to worry about the compiler implementation. :) Yours, Tero [1] Yes, there is ACATS, but as you can see, it does not cover everything.