comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@organon.com (Jon S Anthony)
Subject: Re: Gnat For use at Question
Date: 1996/07/15
Date: 1996-07-15T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Jul14211353@organon.com> (raw)
In-Reply-To: JSA.96Jul11143114@organon.com


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





      parent reply	other threads:[~1996-07-15  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-11  0:00 Gnat For use at Question Spasmo
1996-07-11  0:00 ` Robert Dewar
1996-07-19  0:00   ` Spasmo
1996-07-11  0:00 ` Jerry van Dijk
1996-07-11  0:00 ` Robert A Duff
1996-07-11  0:00 ` Jon S Anthony
1996-07-11  0:00   ` Robert A Duff
1996-07-12  0:00   ` Laurent Guerby
1996-07-13  0:00     ` Jerry van Dijk
1996-07-15  0:00     ` Spasmo
1996-07-12  0:00   ` Jon S Anthony
1996-07-12  0:00   ` Robert Dewar
1996-07-12  0:00   ` Spasmo
1996-07-15  0:00   ` Jon S Anthony
1996-07-15  0:00     ` Spasmo
1996-07-15  0:00     ` Robert Dewar
1996-07-15  0:00     ` Jerry van Dijk
1996-07-15  0:00   ` Jon S Anthony [this message]
replies disabled

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