From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc385bfdaf9461e6 X-Google-Attributes: gid103376,public From: dweller@dfw.net (David Weller) Subject: Re: GNAT 3.03 and Address Clauses Date: 1996/05/04 Message-ID: <4mfob7$fbc@dfw.dfw.net>#1/1 X-Deja-AN: 153219605 references: <31850E0F.136C@software.org> organization: DFWNet -- Public Internet Access newsgroups: comp.lang.ada Date: 1996-05-04T00:00:00+00:00 List-Id: In article <31850E0F.136C@software.org>, Rob Pettit 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