comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Beare <Richard.Beare@cmis.csiro.au>
Subject: aliased variables
Date: 1998/08/13
Date: 1998-08-13T00:00:00+00:00	[thread overview]
Message-ID: <35D264A8.FC025A5F@cmis.csiro.au> (raw)

Hi,
I am having a problem trying to get a program with an aliased variable
to compile. I'm sure I'm missing something obvious 

-------------------------------------------------
procedure Al_Exp is

   type Mt is array(Natural range <>) of Integer;

   type H_Mt is access all Mt;

   K : aliased Mt(1 .. 10);
   L : H_Mt;

begin
    L := K'Access;
end;
-------------------------------------------------
The error message is

gcc -c -gnatv al_exp.adb

GNAT 3.10p (970814) Copyright 1992-1997 Free Software Foundation, Inc.

Compiling: al_exp.adb (source file time stamp: 1998-08-13 03:55:58)

    23.     L := K'Access;
                 |
        >>> object subtype must statically match designated subtype



What's the problem here - I haven't found anything in the RM saying I
can't have general access types pointing to unconstrained arrays - the
Rationale says that arrays of pointers to strings can be created without
dynamic allocation this way, but I haven't been able to get that to work
- what am I doing wrong?

-- 
Richard Beare
Richard.Beare@cmis.csiro.au




             reply	other threads:[~1998-08-13  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-13  0:00 Richard Beare [this message]
1998-08-13  0:00 ` aliased variables Tucker Taft
1998-08-14  0:00   ` Robert Dewar
1998-08-13  0:00 ` David C. Hoos, Sr.
replies disabled

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