From: "Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk>
Subject: Re: Address representation clause is getting 0
Date: Thu, 01 Jan 2004 17:24:35 +0000
Date: 2004-01-01T17:24:35+00:00 [thread overview]
Message-ID: <pan.2004.01.01.17.24.34.956657@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> (raw)
In-Reply-To: vv6h3m13fl4k56@corp.supernews.com
On Wed, 31 Dec 2003 15:48:36 -0600, Randy Brukardt wrote:
> "Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> wrote
> in message
> news:pan.2003.12.31.13.53.00.912339@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.
> uk...
>> I think that this is an elaboration problem. Now as I don't have a runtime
>> or any tools, I need to rely on my own code (think of this as an OS
>> kernel).
>>
>> Does anyone know what I need to do to get this to work?
>
> Ada access objects are initialized to null by default. The object to which
> you applied the address clause is thus getting initialized. You have to tell
> the compiler not to do that, and the way you do that is to give a pragma
> Import. Something like
>
> pragma Import (SB_Block, Ada);
>
> will suppress the initialization, allowing you to read the data.
Not only this, but I had to change all To_Address(*) to
System'To_Address(*) so that I had a static address rather than a function
call.
Also, by adding:
pragma Restrictions(No_Elaboration_Code);
to the start of my spec, I didn't have to call any elaboration code ;-)
All this worked and I can now dump a character to the screen, yay!
Thanks,
Luke.
prev parent reply other threads:[~2004-01-01 17:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-31 12:29 Address representation clause is getting 0 Luke A. Guest
2003-12-31 13:53 ` Luke A. Guest
2003-12-31 21:48 ` Randy Brukardt
2003-12-31 23:03 ` Luke A. Guest
2004-01-01 17:24 ` Luke A. Guest [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox