Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!MITRE-BEDFORD.ARPA!dee%linus From: dee%linus@MITRE-BEDFORD.ARPA (David E. Emery) Newsgroups: comp.lang.ada Subject: Re: Dynamic Address Clauses?? Message-ID: <8806161353.AA17815@linus.MENET> Date: 16 Jun 88 13:53:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 34 Here's a very legitimate use for a dynamic address clause: C often returns addresses of objects (becaues C functions cannot return structures). The following should be perfectly legal AND ACCEPTABLE (i.e. compilers should support this): Ada C type rec is record struct rec { foo : integer; int foo; bar : integer; int bar; end record; }; rec *getstuff(); function getstuff return system.address; pragma interface (C, getstuff); declare myrec : rec; for myrec use at getstuff; -- function call returns system.address. fooval, barval : integer; begin fooval := myrec.foo; barval := myrec.bar; end; Obviously, if address clauses were restricted to be static, this wouldn't work. They're not, so this should be just fine. I've tried this technique on Verdix/Sun, and it works just fine. dave emery emery@mitre-bedford.arpa