comp.lang.ada
 help / color / mirror / Atom feed
From: Per Sandberg <per.sandberg@bredband.net>
To: "Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk>
Cc: comp.lang.ada@ada-france.org
Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why?
Date: Fri, 02 Jan 2004 20:31:53 +0100
Date: 2004-01-02T20:31:53+01:00	[thread overview]
Message-ID: <mailman.202.1073071924.31149.comp.lang.ada@ada-france.org> (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>

To avoid elaboration code is quite simple, just write all your packages 
in such a way that no elaboration code is needed.

The simplest way to make this hapend is to add
	"pragma pure"
or
	"pragma preelaborate"
in all your specs.
Then the compiler will force you to write the code in suh a way that no 
elaboration code is needed.

/Per

Luke A. Guest wrote:

> On Fri, 02 Jan 2004 12:51:56 -0500, Stephen Leake wrote:
> 
> 
>>"Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> writes:
>>
>>
>>>So, my question is this; is this a bug in the compiler or am I missing
>>>something?
>>
>>Try "pragma No_Run_Time" in your gnat.ads file. It says "don't
>>generate _anything_ not directly required by my code", in effect.
>>
>>
>>>I'm currently using GCC-3.3.2 with the FSF GNAT package.
>>
>>"pragma No_Run_Time" may not be supported by this version. Look in the
>>gnat rm for similar pragmas; I think there is one to suppress the enum
>>stuff. 
>>
>>Note that No_Run_Time is not documented.
> 
> 
> I have this in my gnat.adc (not gnat.ads) file:
> 
> pragma No_Run_Time;
> pragma Restrictions(No_Exceptions);
> 
> This is in the GNAT RM from the GCC site:
> 
> "pragma No_Run_Time
>     Syntax:
> 
>           pragma No_Run_Time;
>           
> 
>     This is a configuration pragma that makes sure the user code does not
> use nor need anything from the GNAT run time. This is mostly useful in
> context where code certification is required. Please consult the GNAT Pro
> High-Integrity Edition User's Guide for additional information."
> 
> 
>>>I can remove the redundant code by using the following GCC options
>>>"-ffunction-sections -fdata-sections" and linker option "--gc-sections"
>>>but this is a workaround rather than a solution.
>>
>>Well, GNAT is not normally used to build kernels, and kernels are
>>_not_ like typical user programs. So I would not be surprised to need
>>some extra compiler/linker options. I'd call that a "solution", if
>>there is not a GNAT pragma that does what you need.
> 
> 
> 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.
> 
> Thanks,
> Luke.
> 
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> 




  reply	other threads:[~2004-01-02 19:31 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 [this message]
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
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