comp.lang.ada
 help / color / mirror / Atom feed
From: cktan@julie.teleport.com (Chong-Kwan Tan)
Subject: Re: Help (gnat 3.04)
Date: 1996/06/11
Date: 1996-06-11T00:00:00+00:00	[thread overview]
Message-ID: <ssgn32aavlh.fsf@julie.teleport.com> (raw)
In-Reply-To: ssgafybjgo9.fsf@kelly.teleport.com


Hi,

I have found the problem. Could have used a more meaning error message
from gnat.

The solution is to change procedure Init(Pool : in out Pool_type) 
to procedure Init(Pool: access Pool_type).

-tan

================================================================ 
In article <ssgafybjgo9.fsf@kelly.teleport.com>
cktan@kelly.teleport.com (Chong-Kwan Tan) writes:

   From: cktan@kelly.teleport.com (Chong-Kwan Tan)
   Newsgroups: comp.lang.ada
   Date: 10 Jun 1996 18:03:18 -0700
   Organization: Teleport - Portland's Public Access (503) 220-1016
   Path: nntp.teleport.com!usenet
   Lines: 49
   Sender: cktan@kelly.teleport.com
   NNTP-Posting-Host: kelly.teleport.com
   X-Newsreader: Gnus v5.0.15

   Hi,

   I am trying to link all items in an array into a list and gnat 3.04 gives
   me this error:
       % gnatmake tt.adb
       gcc -c tt.adb
       tt.adb:21:37: object has deeper accessibility level than access type
       gnatmake: "tt.adb" compilation error

   Could someone tell me why?

   Thanks,
   -tan

   ====================================================================
	1  procedure TT is
	2
	3     type Item_Type;
	4     type Item_Ptr_Type is access all Item_Type;
	5     type Item_Type is
	6        record
	7           Next           : Item_Ptr_Type;
	8        end record;
	9     type Item_Table_Type is
       10        array (Positive range <>) of aliased Item_Type;
       11
       12     type Pool_Type is
       13        record
       14           Item    : Item_Table_Type(1..10);
       15        end record;
       16
       17     procedure Init
       18       (Pool : in out Pool_Type) is
       19     begin
       20        for I in 2 .. Pool.Item'Last loop
       21           Pool.Item(I-1).Next := Pool.Item(I)'Access;
       22        end loop;
       23        Pool Pool.Item(I)'Access;
       22        end loop;
       23        Pool.Item(Pool.Item'Last).Next := null;
       24     end Init;
       25
       26     P : Pool_Type;
       27  begin
       28     Init(P);
       29  end TT;
   -- 
   cktan@teleport.COM  Public Access User --- Not affiliated with Teleport
   Public Access UNIX and Internet at (503) 220-1016 (2400-28800, N81)
-- 
cktan@teleport.COM  Public Access User --- Not affiliated with Teleport
Public Access UNIX and Internet at (503) 220-1016 (2400-28800, N81)




  reply	other threads:[~1996-06-11  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-10  0:00 Help (gnat 3.04) Chong-Kwan Tan
1996-06-11  0:00 ` Chong-Kwan Tan [this message]
1996-06-14  0:00 ` Nasser Abbasi
replies disabled

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