comp.lang.ada
 help / color / mirror / Atom feed
* Overriding discriminants perplexes GNAT 3.14p
@ 2002-09-19  2:32 Dmitry A.Kazakov
  2002-09-18 16:45 ` Stephen Leake
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Dmitry A.Kazakov @ 2002-09-19  2:32 UTC (permalink / raw)


Hi!

The following primitive code causes "GNAT bug detected" report:
--------
with Ada.Finalization; use Ada.Finalization;

package Test1 is
   type X (N : Natural) is
      new Ada.Finalization.Limited_Controlled with private;
   procedure Initialize (Obj : in out X);
private
   type X (N : Natural) is
      new Ada.Finalization.Limited_Controlled with
   record
      NS : String (1..N);
   end record;
end Test1;
----------
package body Test1 is
   procedure Initialize (Obj : in out X) is
   begin
      null;
   end Initialize;
end Test1;
----------
package Test1.Test2 is
   type XX (M : Natural; N : Natural)  is new X with private;
   procedure Initialize (Obj : in out XX);
private
   type XX (M : Natural; N : Natural)  is new X (N) with
   record
      MS : String (1..M);
   end record;
end Test1.Test2;
----------
package body Test1.Test2 is
   procedure Initialize (Obj : in out XX) is
   begin
      Initialize (X (Obj));
   end Initialize;
end Test1.Test2;
----------
package Test1.Test2.Test3 is
   type XXX is new XX (10, 20) with private;
   procedure Initialize (Obj : in out XXX);
private
   type XXX is new XX (10, 20) with null record;
end Test1.Test2.Test3;
----------
package body Test1.Test2.Test3 is
   procedure Initialize (Obj : in out XXX) is
   begin
      Initialize (XX (Obj));
   end Initialize;
end Test1.Test2.Test3;
----------
1. Unconstrained type X has a discriminant
2. Unconstrained XX (derived from X) has two disriminants. It overrides the 
discriminant of X
3. Constrained XXX is derived from XX.

This results in a bug report (crash)  under Windows.

What wonders me is which sort of validation uses ACT if such bugs go 
through? People rightly criticize MS VC++, but the situation with Ada 
compilers isn't much better. I judge from my experience with GNAT and 
Object Ada. It is a permanent battle of finding work-arounds for countless 
compiler bugs. Is there any good Ada compilers since DEC gone?

-- 
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: Overriding discriminants perplexes GNAT 3.14p
@ 2002-09-19  9:08 Grein, Christoph
  0 siblings, 0 replies; 31+ messages in thread
From: Grein, Christoph @ 2002-09-19  9:08 UTC (permalink / raw)


From: Thierry Lelegard <thierry.lelegard@canal-plus.fr>
> Ah! DEC Ada! The best Ada compiler ever... No Ada95 version, sigh :-((
> I have used it during 12 years and got less than 10 bugs. We have been
> using GNAT for 4 years and we submitted 185 reports, 107 of them being bugs...
> On the other hand, ACT support is very efficient. All bugs are fixed and
> new version delivered within days.

A reason for this might be: More experienced Ada programmer uses more elaborate features. 
Also Ada 95 added a lot of new features.

But the discrepancy in numbers is stupendous.



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2002-09-24  9:40 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19  2:32 Overriding discriminants perplexes GNAT 3.14p Dmitry A.Kazakov
2002-09-18 16:45 ` Stephen Leake
2002-09-19 21:34   ` Dmitry A.Kazakov
2002-09-19 15:51     ` Stephen Leake
2002-09-20 22:06       ` Dmitry A.Kazakov
2002-09-20 12:29         ` Stephen Leake
2002-09-22  8:43           ` Dmitry A.Kazakov
2002-09-22 13:32             ` Georg Bauhaus
2002-09-23  5:41               ` Dmitry A.Kazakov
2002-09-23 12:41                 ` Georg Bauhaus
2002-09-24  1:38                   ` Dmitry A.Kazakov
2002-09-23 15:33             ` Stephen Leake
2002-09-24  8:35               ` Dmitry A. Kazakov
2002-09-19 18:22     ` Adam Beneschan
2002-09-20 22:06       ` Dmitry A.Kazakov
2002-09-20 16:00         ` Adam Beneschan
2002-09-22  8:43           ` Dmitry A.Kazakov
2002-09-23 21:18             ` Adam Beneschan
2002-09-24  9:40               ` Dmitry A. Kazakov
2002-09-21 13:01     ` Simon Wright
2002-09-18 16:46 ` Mark Johnson
2002-09-19 21:34   ` Dmitry A.Kazakov
2002-09-19 16:17     ` Stephen Leake
2002-09-19 20:02       ` tmoran
2002-09-20 21:10       ` Dmitry A.Kazakov
2002-09-21 12:56       ` Simon Wright
2002-09-18 16:49 ` Frank J. Lhota
2002-09-19 21:34   ` Dmitry A.Kazakov
2002-09-18 17:17 ` Per Sandbergs
2002-09-19  8:51 ` Thierry Lelegard
  -- strict thread matches above, loose matches on Subject: below --
2002-09-19  9:08 Grein, Christoph

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