comp.lang.ada
 help / color / mirror / Atom feed
From: dweller@dfw.net (David Weller)
Subject: Re: GNAT 3.03  and Address Clauses
Date: 1996/05/04
Date: 1996-05-04T00:00:00+00:00	[thread overview]
Message-ID: <4mfob7$fbc@dfw.dfw.net> (raw)
In-Reply-To: 31850E0F.136C@software.org


In article <31850E0F.136C@software.org>,
Rob Pettit  <pettit@software.org> wrote:
[Indicated he was having trouble with this code:]
>        Device_Data    : Device_Data_Type;   
>        Device_Address : constant System.Address 
>           := System.Storage_Elements.To_Address(16#FFFF_0000#);
>
>        for Device_Data'Address use Device_Address;
>
>     end Address_Test;
>
>GNAT 3.03 subsequently gives the following error message:
>     address_test.ads:13:32: invalid address clause for "Device_Data"
>     address_test.ads:13:32: must be constant defined before "Device_Data" 
>        (RM 13.1(22))
>
>Can anyone provide advice for compiling this code using GNAT?
>Thanks in advance!
>


The solution is pretty easy, GNAT's giving you a pretty strong hint:

        Device_Address : constant System.Address
           := System.Storage_Elements.To_Address(16#FFFF_0000#);
        Device_Data    : Device_Data_Type;

        for Device_Data'Address use Device_Address;


Will compile just fine.


(Don't feel too silly, I made the same mistake about a year ago :-)

-- 
    Visit the Ada 95 Booch Components Homepage: www.ocsystems.com/booch
           This is not your father's Ada -- lglwww.epfl.ch/Ada




  parent reply	other threads:[~1996-05-04  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-29  0:00 GNAT 3.03 and Address Clauses Rob Pettit
1996-04-29  0:00 ` Robert A Duff
1996-05-04  0:00 ` David Weller [this message]
1996-05-06  0:00   ` Robert Dewar
replies disabled

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