comp.lang.ada
 help / color / mirror / Atom feed
* Help (gnat 3.04)
@ 1996-06-10  0:00 Chong-Kwan Tan
  1996-06-11  0:00 ` Chong-Kwan Tan
  1996-06-14  0:00 ` Nasser Abbasi
  0 siblings, 2 replies; 3+ messages in thread
From: Chong-Kwan Tan @ 1996-06-10  0:00 UTC (permalink / raw)



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)




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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-10  0:00 Help (gnat 3.04) Chong-Kwan Tan
1996-06-11  0:00 ` Chong-Kwan Tan
1996-06-14  0:00 ` Nasser Abbasi

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