From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Using pointers with inline assembly in Ada Date: Fri, 10 Jun 2022 15:19:30 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 10 Jun 2022 13:19:30 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="57e2f04b319b314c1505a3472859f8ad"; logging-data="8166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2mWlEEmN92jAQ20OYqH7oLETjjRHzXA4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cancel-Lock: sha1:YY0RwKSDkhptF0YYcKCIuvkHZlM= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63964 List-Id: On 2022-06-10 14:16, NiGHTS wrote: > > I also am not entirely sure why there would be a difference between the address of the first element versus the address of the array itself (maybe that's just my C instincts kicking in). Unlike C, an Ada array has associated bounds information. Sometimes that bounds information is physically stored with the array data, usually before them. There is implementation advice that A'Address and A (A'First)'Address should give the same address, but some compilers return the address of the bounds information. In your particular case, the bounds are static, so the compiler probably doesn't store them, and GNAT follows the implementation advice, so there is no difference in the two forms in any case. -- Jeff Carter "I'm a lumberjack and I'm OK." Monty Python's Flying Circus 54