From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why?
Date: Fri, 02 Jan 2004 20:12:28 -0500
Date: 2004-01-02T20:12:28-05:00 [thread overview]
Message-ID: <c4ednSyzZsZhi2uiRVn-sA@comcast.com> (raw)
In-Reply-To: <pan.2004.01.02.18.14.48.347041@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk>
Luke A. Guest wrote:
> Although a kernel is not a *normal* program, Ada was designed to be
> used in the embedded sector with or without an OS, so there must be a
> solution as somebody must've needed to do what I'm wanting to do at some point.
It depends on what you need done. I'm not sure, but from what you have
posted it sounds like you have a data structure that has to be located
at a particular location, and not be initialized by GNAT.
pragma No_Run_Time will not do this. You need to use pragma Import if
you don't want the access values to be set by default to null. This is
not done by the run-time, it is done by the elaboration code for the
unit where the imported object is declared, usually the main program.
See RM B.1(24). This is one of those things which makes sense once you
grok the whole--the only case where you don't want default
initializations is where the initializations are explicitly performed by
non-Ada code. But it is often the case that the object you need not to
be default initialized when calling C code is a pointer, not the data
itself. Sometimes you even need two pragma Imports for one object, one
for a pointer, and one for the data object itself.
--
Robert I. Eachus
"The war on terror is a different kind of war, waged capture by capture,
cell by cell, and victory by victory. Our security is assured by our
perseverance and by our sure belief in the success of liberty." --
George W. Bush
next prev parent reply other threads:[~2004-01-03 1:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-02 11:59 [No_Elaboration_Code] GNAT still generating rep_to_pos, why? Luke A. Guest
2004-01-02 17:51 ` Stephen Leake
2004-01-02 18:14 ` Luke A. Guest
2004-01-02 19:31 ` Per Sandberg
2004-01-02 19:46 ` Luke A. Guest
2004-01-02 21:17 ` Stephen Leake
2004-01-02 22:16 ` Luke A. Guest
2004-01-03 1:43 ` Stephen Leake
[not found] ` <87ekuhe5wq.fsf@news.sdbk.de>
2004-01-03 9:58 ` Luke A. Guest
2004-01-03 8:44 ` Luke A. Guest
2004-01-03 1:12 ` Robert I. Eachus [this message]
2004-01-03 8:41 ` Luke A. Guest
2004-01-03 11:53 ` Simon Wright
2004-01-03 12:20 ` Luke A. Guest
2004-01-04 12:26 ` Simon Wright
2004-01-03 1:41 ` sk
2004-01-03 2:29 ` Luke A. Guest
2004-01-03 10:48 ` Florian Weimer
2004-01-03 11:32 ` Luke A. Guest
2004-01-03 13:11 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox