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,546b2e2a44f83809 X-Google-Attributes: gid103376,public From: jsa@organon.com (Jon S Anthony) Subject: Re: Gnat For use at Question Date: 1996/07/15 Message-ID: #1/1 X-Deja-AN: 168355460 sender: news@organon.com (news) references: <4s2eb5$qt6@masala.cc.uh.edu> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-07-15T00:00:00+00:00 List-Id: In article <4s6fk5$du5@masala.cc.uh.edu> cosc19z5@Bayou.UH.EDU (Spasmo) writes: > Jon S Anthony (jsa@organon.com) wrote: > : In article <4s2eb5$qt6@masala.cc.uh.edu> cosc19z5@Bayou.UH.EDU (Spasmo) writes: > > : > I'm trying to create an array at an absolute memory location, but > : > I keep on getting some error with "expect System.Address blah blah" > : > whenever I try. > > : Actually, the error messages are _extremely_ clear and tell you _exactly_ > : what is wrong and even how to fix it: > > Well I never said that the error message was unclear, I was however > quite unfamiliar with what it was saying. It made mention of a > "System.Address", but I couldn't figure out what it meant (I'm > an Ada newbie BTW). Oh. Sorry. > > > : procedure Junk2 is > : Some_Array : String(1..4000); > : for Some_Array'Address use 16#bbbbb#; > : begin > : null; > : end; > > > : $ gnat junk2.adb > : junk2.adb:4:36: expected private type "System.Address" > : junk2.adb:4:36: found type universal integer > : junk2.adb:4:36: invalid address clause for "Some_Array" > : junk2.adb:4:36: must be constant defined before "Some_Array" (RM 13.1(22)) > > That's exactly what I got. The thing is I don't have the RM so > I was unable to look up the specifics. The best thing to do here is grab the HTML version or just use the online HTML version at http://lglwww.epfl.ch/Ada/ > : for Some_Array'Address use Some_Array_Address; > > Is the 'Address necessary? Every book I have doesn't mention > it but just says for Some_Array. It will be. It is the Ada95 syntax for this and is really much better in that it comes under the more regular umbrella of attribute clauses. The "use at" stuff is Ada83 which will be accepted for some period of time but is an "obsolete feature". > Hmmmm ok, well here's a question about To_Address. Since PC's use > segment, base addressing, is there an overload of To_Address that > accepts both a segment and base, or is it up to us to "massage" > the number into the proper format for To_Address? Are there any > functions that do this "massaging" for us? Thanks for the help. Good question. If there is it will be an implementation extension. LabTek? ACT? Tomson? /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com