TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Stephen Leake <[log in to unmask]>
Reply To:
Stephen Leake <[log in to unmask]>
Mon, 20 May 2002 16:40:04 -0400
text/plain (31 lines)
"C. Daniel Cooper" <[log in to unmask]> writes:

> > <someone else wrote:>
> >
> > > If you are using GNAT compiler then you may consider the Code_Address
> > attribute instead of Access (see Implementation Defined Attributes in
> > GNAT Reference Manual).
> Since I don't have access to the Reference Manual: does 'Code_Address
> meet the two-fold developer expectation, namely: provide the desired
> comparison guarantee, as well as invocation of the subprogram thus
> designated? If so, could it be standardized? At the very least, it
> is an existence proof that the language limitation -could- be removed.

Here's the relevant bit of the manual:

     The `'Code_Address' attribute, which can only be applied to
     subprogram entities, always returns the address of the start of the
     generated code of the specified subprogram, which may or may not be
     the same value as is returned by the corresponding `'Address'

Earlier, it says 'Address can be used to call the subprogram. GNAT
doesn't do shared generics, so they don't have the concerns Randy
does. I guess in Janus Ada, 'Code_Address could be defined to be
useful for subprogram comparison. Better would be a new attribute

-- Stephe