comp.lang.ada
 help / color / mirror / Atom feed
* "Selected Component" problem with GNAT
@ 1996-11-15  0:00 Ken Garlington
  1996-11-15  0:00 ` Robert A Duff
  0 siblings, 1 reply; 5+ messages in thread
From: Ken Garlington @ 1996-11-15  0:00 UTC (permalink / raw)
  To: report


I have the following source code, which compiles, links, and runs OK
on a couple of different Ada 83 compilers (DEC Ada, Tartan):

package Test_Rec is

  type A_Record_Type is record
    A_Component : Boolean;
  end record;

  function A_Record return A_Record_Type;

  procedure A_Record ( Result : out A_Record_Type );

end Test_Rec;

package body Test_Rec is

  function A_Record return A_Record_Type is
  begin
    return A_Record_Type'(A_Component => True);
  end A_Record;

  procedure A_Record ( Result : out A_Record_Type ) is
  begin
    Result := A_Record;
  end A_Record;

end Test_Rec;

with Test_Rec;
with Text_IO;
procedure A_Test is
begin
  if Test_Rec.A_Record.A_Component then
    Text_IO.Put_Line("I knew that!");
  end if;
end A_Test;

I received a report that GNAT doesn't like this code. I tried it on
WebAda, and got the following error:

GNAT 3.07 (961007) Copyright 1991-1996 Free Software Foundation, Inc.

Checking: /export/user_data/ada_source/www.lmtas.com/a_test.adb (source 
file time stamp: 1996-11-15 19:01:39)

     1. with Test_Rec;
     2. with Text_IO;
     3. procedure A_Test is
     4. begin
     5.   if Test_Rec.A_Record.A_Component then
                              |
        >>> invalid prefix in selected component "A_Record"

     6.     Text_IO.Put_Line("I knew that!");
     7.   end if;
     8. end A_Test;
     9. 

 9 lines: 

Is this a GNAT bug, a bug in the Ada 83 compilers, or something else?

-- 
LMTAS - "Our Brand Means Quality"
For more info, see http://www.lmtas.com or http://www.lmco.com




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

* Re: "Selected Component" problem with GNAT
  1996-11-15  0:00 "Selected Component" problem with GNAT Ken Garlington
@ 1996-11-15  0:00 ` Robert A Duff
  1996-11-20  0:00   ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: Robert A Duff @ 1996-11-15  0:00 UTC (permalink / raw)



In article <328C6C42.3D73@lmtas.lmco.com>,
Ken Garlington  <garlingtonke@lmtas.lmco.com> wrote:
>  if Test_Rec.A_Record.A_Component then

This code looks correct to me.

>Is this a GNAT bug, a bug in the Ada 83 compilers, or something else?

Looks like a GNAT bug.

- Bob




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

* Re: "Selected Component" problem with GNAT
  1996-11-15  0:00 ` Robert A Duff
@ 1996-11-20  0:00   ` Robert Dewar
  1996-11-22  0:00     ` Ken Garlington
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Dewar @ 1996-11-20  0:00 UTC (permalink / raw)



Robert Duff said

">  if Test_Rec.A_Record.A_Component then

This code looks correct to me.

>Is this a GNAT bug, a bug in the Ada 83 compilers, or something else?

Looks like a GNAT bug."

Yes, it is a GNAT bug, but one that is fixed in the current version
of GNAT.





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

* Re: "Selected Component" problem with GNAT
  1996-11-20  0:00   ` Robert Dewar
@ 1996-11-22  0:00     ` Ken Garlington
  1996-11-25  0:00       ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: Ken Garlington @ 1996-11-22  0:00 UTC (permalink / raw)



Robert Dewar wrote:
> 
> Robert Duff said
> 
> ">  if Test_Rec.A_Record.A_Component then
> 
> This code looks correct to me.
> 
> >Is this a GNAT bug, a bug in the Ada 83 compilers, or something else?
> 
> Looks like a GNAT bug."
> 
> Yes, it is a GNAT bug, but one that is fixed in the current version
> of GNAT.

By the way, the gentleman who reported this bug to me said that he was 
using GNAT 3.08w. I believe he was on Solaris.

-- 
LMTAS - "Our Brand Means Quality"
For more info, see http://www.lmtas.com or http://www.lmco.com




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

* Re: "Selected Component" problem with GNAT
  1996-11-22  0:00     ` Ken Garlington
@ 1996-11-25  0:00       ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 1996-11-25  0:00 UTC (permalink / raw)



Ken Garlington said

"By the way, the gentleman who reported this bug to me said that he was
using GNAT 3.08w. I believe he was on Solaris."

This bug is, as I noted earlier, fixed in the current version of GNAT,
including the Solaris version. Remember that the "w" in 3.08w means
a wavefront version, and the full version number with the date, is
necessary to uniquely identify a GNAT version.





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

end of thread, other threads:[~1996-11-25  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-15  0:00 "Selected Component" problem with GNAT Ken Garlington
1996-11-15  0:00 ` Robert A Duff
1996-11-20  0:00   ` Robert Dewar
1996-11-22  0:00     ` Ken Garlington
1996-11-25  0:00       ` Robert Dewar

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