comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A.Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Overriding discriminants perplexes GNAT 3.14p
Date: Thu, 19 Sep 2002 23:34:18 +0200
Date: 2002-09-19T23:34:18+02:00	[thread overview]
Message-ID: <amc58u$4ebgo$1@ID-77047.news.dfncis.de> (raw)
In-Reply-To: un0qfb624.fsf@gsfc.nasa.gov

Stephen Leake wrote:

> Dmitry A.Kazakov <mailbox@dmitry-kazakov.de> writes:
> 
>> People rightly criticize MS VC++, but the situation with Ada
>> compilers isn't much better.
> 
> Yes it is (in my experience). I've found bugs in _every_ compiler I've
> ever used. At least with GNAT I have a chance of getting them fixed!

First of all there are bugs and bugs. GNAT is at least ten years old, so I 
would expect that one could not catch it on such primitive things. What you 
are talking about is merely a quality of support, which is a very important 
but yet another thing. Moreover, from what Robert Dewar said before his 
departure, it looks like excellent and thus expensive support actually 
harms quality. ACT intentionally limits the number of GNAT users by those 
with very deep pockets and applications which do not require all stregths 
of Ada. Should GNAT Pro be affordable for small and medium sized projects, 
then Ada would be applied much more wider with so terrifying ACT 
consequence of an increasing support demand.

> And they are in more and more obscure corners of the language as time
> goes on and more testing is done. MS VC++ bugs are in the core of the
> language, and they have no problem with not being standard-compliant,
> and they introduce new bugs with every release.
> 
>> I judge from my experience with GNAT and Object Ada.
> 
> GNAT is better than Object Ada

I wouldn't say that. From my sad experience [I was forced to create a small 
validation site] Object Ada compiles many examples which perplexe GNAT. It 
also makes a better code. The major problem with Object Ada is that it 
sometimes hangs and sometimes joyfully generates nonsense, especially when 
it tries to optimize return statements with controlled types. 

>> It is a permanent battle of finding work-arounds for countless
> 
> Hmm. I have a record of all the bugs I've submitted. Total is 24, over
> 3 years. And that includes some Emacs Ada-mode bugs. Hardly "countless"!
> 
>> compiler bugs. Is there any good Ada compilers since DEC gone?
> 
> DEC was good. GNAT is better! And yes, I _did_ find bugs in the DEC
> Ada compiler.

Lucky one (:-)). For five years GNAT was unable to compile my program in 
Ada 83 written for DEC Ada. [I must admit, I slightly overused generics 
there]

Yes *now* GNAT is better than DEC Ada that time. Though there is nothing 
comparable with LSE and DEC debugger. But what if mismanagement and "new 
economy" didn't kill DEC?

> Compilers are _extremely_ complicated systems. It is _not_ possible to
> ensure they have no bugs.
> 
> Please report your bug to report@gnat.com, following the instructions
> in the GNAT BUG box. Or let me know, and I'll do it.

It is better if you do that, because you are working with 3.15. Here is a 
pair of "gems" from my collection:

1. The requeue statement is abortable, while it should not be:
 
package Objects is
   protected Object is
      entry Point1;
      entry Point2;
   end Object;
end Objects;
------------
package body Objects is
   protected body Object is
      entry Point1 when True is
      begin
         requeue Point2;
      end Point1;
      entry Point2 when False is
      begin
         null;
      end Point2;
   end Object;
end Objects;
------------
with Ada.Text_IO;  use Ada.Text_IO;
with Objects;

procedure Test is
begin
   select
      delay 2.0;
   then abort
      Objects.Object.Point1;
   end select;
   Put_Line ("Never be here, because Point1 isn't abortable");
end Test;
-------------

2. Circular requeue hangs at run-time under Linux:

package Objects is
   protected Object1 is
      entry Point1;
      entry Point2;
   end Object1;
   protected Object2 is
      entry Point1;
   end Object2;
end Objects;
------------
package body Objects is
   protected body Object1 is
      entry Point1 when True is
      begin
         requeue Object2.Point1;
      end Point1;
      entry Point2 when True is
      begin
         null;
      end Point2;
   end Object1;
   protected body Object2 is
      entry Point1 when True is
      begin
         requeue Object1.Point2;
      end Point1;
   end Object2;
end Objects;
------------
with Ada.Text_IO;  use Ada.Text_IO;
with Objects;

procedure Test is
begin
   Objects.Object1.Point1;
   Put_Line ("That's OK");
end Test;

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



  reply	other threads:[~2002-09-19 21:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
replies disabled

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