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,c30642befcd7bf85 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: New GNAT ports (was Re: Ada and Automotive Industry) Date: 1997/01/08 Message-ID: #1/1 X-Deja-AN: 208730075 references: <5asvku$jtu$1@goanna.cs.rmit.edu.au> <5avdtl$hir$1@goanna.cs.rmit.edu.au> organization: New York University newsgroups: comp.lang.ada Date: 1997-01-08T00:00:00+00:00 List-Id: 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.