comp.lang.ada
 help / color / mirror / Atom feed
From: dale@cs.rmit.edu.au (Dale Stanbrough)
Subject: Re: simple question - how to emulate void * ?
Date: 1998/10/24
Date: 1998-10-24T12:14:34+00:00	[thread overview]
Message-ID: <dale-2410982216230001@dale.ppp.cs.rmit.edu.au> (raw)
In-Reply-To: 1104_909142646@DZOG-CHEN

Ed Falis wrote:

"In OA, both System and System.Storage_Units declare "+" operators with Address
 and Integer or Storage_Offset respectively.  Since there are use clauses 
 for both units, the compiler doesn't know how to interpret the numeric literal 
 "1" on the right hand side of the expression.
 
 So, eliminate one of the use clauses, or qualify the literal, e.g. Integer'(1)
 or Storage_Offset'(1), and the code will compile and execute.
 
 My guess is that the address arithmetic in OA System was left in for
 compatibility with the Alsys Ada 83 compilers it replaced.
 
 - Ed Falis
 Aonix"



This is then a problem with Ada, that the legality of calling a routine in
a child package can be affected by the exact definition of a type defined
as "implementation defined".

package System has...

   type Address is <implementation defined>;


package System.Storage_Elements is...

   address manipulation routines such as +, - and mod.


If Address is defined as an integer type, then it automatically gets all
of the numeric operations inherited.

If Address is an access type, then it gets not much.

Perhaps it would have been better if the LRM specifically excluded these
operations from package System.Address, given the presence of
System.Storage_Elements. Perhaps we need to understand the rationale of
having

   type Address is <impl. defined>

vs.

   type Address is private;

I certainly haven't hit this particular problem before, and it _is_
an annoying "feature". Can anyone clarify this point for me?


Dale




  parent reply	other threads:[~1998-10-24  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-23  0:00 simple question - how to emulate void * ? Craig Allen
1998-10-23  0:00 ` Dale Stanbrough
1998-10-22  0:00   ` Hans Marqvardsen
1998-10-23  0:00     ` John McCabe
1998-10-23  0:00       ` Ed Falis
1998-10-23  0:00         ` dennison
1998-10-24  0:00           ` Joe Wisniewski
1998-10-25  0:00           ` dewar
1998-10-24  0:00         ` Dale Stanbrough [this message]
1998-10-24  0:00           ` Robert A Duff
1998-10-24  0:00           ` Tucker Taft
1998-10-23  0:00       ` dennison
1998-10-22  0:00   ` Hans Marqvardsen
1998-10-23  0:00   ` David C. Hoos, Sr.
1998-10-23  0:00   ` David C. Hoos, Sr.
1998-10-23  0:00 ` Jeff Carter
1998-10-24  0:00   ` Dale Stanbrough
1998-10-25  0:00     ` dewar
1998-10-23  0:00 ` Tom Moran
1998-11-05  0:00 ` Craig Allen
1998-11-06  0:00   ` Dale Stanbrough
1998-11-06  0:00     ` Matthew Heaney
1998-11-06  0:00       ` dewarr
1998-11-06  0:00   ` Tom Moran
replies disabled

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