comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tero.koskinen@iki.fi>
Subject: Re: Position of "use"
Date: Thu, 10 Jul 2014 20:47:35 +0300
Date: 2014-07-10T20:47:35+03:00	[thread overview]
Message-ID: <lpmjjq$2n6$1@loke.gir.dk> (raw)
In-Reply-To: <b39d4ee8-b275-46ab-8212-bf2fef7fab4a@googlegroups.com>

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.

  reply	other threads:[~2014-07-10 17:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05  6:43 Position of "use" Victor Porton
2014-07-05  7:12 ` J-P. Rosen
2014-07-07 16:45   ` Adam Beneschan
2014-07-07 17:08     ` Pascal Obry
2014-07-07 17:40       ` Peter Chapin
2014-07-07 19:17       ` Adam Beneschan
2014-07-08  5:26     ` J-P. Rosen
2014-07-08 15:32       ` Adam Beneschan
2014-07-08 19:30 ` Adam Beneschan
2014-07-08 22:39   ` Victor Porton
2014-07-09 10:36 ` anon
2014-07-09 15:14   ` Adam Beneschan
2014-07-10  1:27     ` anon
2014-07-10  9:50       ` AdaMagica
2014-07-10 13:10         ` J-P. Rosen
2014-07-10 15:57           ` Adam Beneschan
2014-07-10 17:47             ` Tero Koskinen [this message]
2014-07-10 19:15           ` Jeffrey Carter
2014-07-15  5:56         ` anon
2014-07-15  7:36           ` Georg Bauhaus
2014-07-15 17:01             ` Simon Wright
2014-07-15 17:23               ` Jeffrey Carter
2014-07-15 19:44                 ` Simon Wright
2014-07-15 17:47               ` G.B.
2014-07-15 17:51               ` Adam Beneschan
2014-07-15 20:04                 ` Simon Wright
2014-07-16  7:19                 ` anon
2014-07-10 15:54       ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox