comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: New GNAT ports (was Re: Ada and Automotive Industry)
Date: 1997/01/08
Date: 1997-01-08T00:00:00+00:00	[thread overview]
Message-ID: <dewar.852774165@merv> (raw)
In-Reply-To: 5avdtl$hir$1@goanna.cs.rmit.edu.au


Richard says

"I note that AI-00336/05-ra-WJ says that
        "An address clause cannot be given for a subprogram
         whose body acts as its declaration."
which I take to mean that a subprogram can have a normal body or
an address clause but not both.  A fortiori, I didn't expect
address clauses to work for labels either.  It certainly wasn't
legal syntax in Ada 83, according to LRM 13.5."


You are confused, the quoted sentence simly says that if you have
an address clause for a subprogram, it must have a separate spec. The
conclusion you draw does not follow. 

As for address on labels, in Ada 83, you could not specify the value
of attributes in general, but in Ada 95 you can with an attribute
definition clause. Since Address clearly aplies to labels:

11  X'Address
                Denotes the address of the first of the storage elements
                allocated to X. For a program unit or label, this value
                refers to the machine code associated with the corresponding
                body or statement.  The value of this attribute is of type
                System.Address.

This certainly means that an implementation *may* support the address 
clause for a label. 

The only requirement (well it is a requirement if Annex C is supported) is:

   17  An implementation should support Address clauses for imported
       subprograms.


So, you are not required to support address clauses for non-imported
subprograms, but in an embedded environment, it may well make sense
to support this.

Although it should be noted that an alternative mechanism to expressing
this kind of thing at the language level is to use what Intel would call
a locator to place code at specific locations in the final load image.





  reply	other threads:[~1997-01-08  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-24  0:00 New GNAT ports (was Re: Ada and Automotive Industry) Robert Dewar
1996-12-27  0:00 ` New GNAT ports John Howard
1997-01-07  0:00 ` New GNAT ports (was Re: Ada and Automotive Industry) Richard A. O'Keefe
1997-01-07  0:00   ` Ken Garlington
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-08  0:00       ` Robert Dewar
1997-01-09  0:00         ` Richard A. O'Keefe
1997-01-11  0:00           ` Robert Dewar
1997-01-11  0:00         ` Addresses of Subprograms (was: New GNAT ports) Larry Kilgallen
1997-01-13  0:00           ` Larry Kilgallen
1997-01-14  0:00             ` Richard A. O'Keefe
1997-01-14  0:00               ` Fergus Henderson
1997-01-15  0:00             ` Richard Kenner
1997-01-09  0:00       ` New GNAT ports (was Re: Ada and Automotive Industry) Ken Garlington
1997-01-07  0:00   ` Robert A Duff
1997-01-07  0:00     ` Robert Dewar
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-09  0:00       ` Dr. Peter E. Obermayer
1997-01-07  0:00   ` Robert Dewar
1997-01-08  0:00     ` Ken Garlington
1997-01-08  0:00     ` Richard A. O'Keefe
1997-01-08  0:00       ` Robert Dewar [this message]
1997-01-08  0:00   ` Karl Cooper
1997-01-08  0:00     ` Robert Dewar
1997-01-09  0:00     ` Richard A. O'Keefe
1997-01-09  0:00       ` Robert Dewar
1997-01-09  0:00   ` Robert I. Eachus
1997-01-10  0:00   ` Robert I. Eachus
1997-01-11  0:00     ` Robert Dewar
1997-01-13  0:00       ` Richard A. O'Keefe
replies disabled

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