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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9f3d09bde7b33b5d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-09 23:37:26 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Pass by reference Date: 10 Apr 2004 07:33:14 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <19b0e504.0404080652.4eab9f80@posting.google.com> <5QAdc.7896$Jf6.4030@newssvr23.news.prodigy.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1081579045 17447 62.49.19.209 (10 Apr 2004 06:37:25 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 10 Apr 2004 06:37:25 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:6938 Date: 2004-04-10T07:33:14+01:00 List-Id: Vinzent 'Gadget' Hoefler writes: > Pat Rogers wrote: > > >If you made the type volatile that would also force by-reference. C.6(18): If a type is atomic or volatile and it is not a by-copy type, then the type is defined to be a by-reference type. If any subcomponent of a type is atomic or volatile, then the type is defined to be a by-reference type. > Are you sure? I'm just looking at the assembly ouput of GNAT for a > procedure that takes a volatile type (memory mapped register) and it > does't seem so. Even worse, it optimizes the sequence of assignment > which I need for this register. If you have any idea how can I avoid > using access types to make it right, I'd be glad to hear it. I think you need to use inline assembler to be sure. And to be really sure you may need to use Volatile => True on the call, I had to (this was GNAT/PowerPC, by the way). -- Simon Wright 100% Ada, no bugs.