comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not>
Subject: Re: Using pointers with inline assembly in Ada
Date: Fri, 10 Jun 2022 15:19:30 +0200	[thread overview]
Message-ID: <t7vgd2$7v6$1@dont-email.me> (raw)
In-Reply-To: <cb332860-e55d-48a7-81b2-1ed1edf45dcan@googlegroups.com>

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

  reply	other threads:[~2022-06-10 13:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 21:30 Using pointers with inline assembly in Ada NiGHTS
2022-06-10  5:24 ` Rod Kay
2022-06-10 11:16   ` Luke A. Guest
2022-06-10 12:26     ` NiGHTS
2022-06-10 12:16   ` NiGHTS
2022-06-10 13:19     ` Jeffrey R.Carter [this message]
     [not found]   ` <nnd$727405a5$1c8a5b81@aedbf58048bf777d>
2022-06-10 12:23     ` NiGHTS
2022-06-11  1:43   ` Rod Kay
2022-06-10 13:39 ` Jeffrey R.Carter
2022-06-11  1:51   ` NiGHTS
2022-06-11 12:28 ` Simon Wright
2022-06-11 12:32   ` NiGHTS
2022-06-13 20:33 ` Gabriele Galeotti
replies disabled

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