From: Mark Lorenzen <mark.lorenzen@gmail.com>
Subject: Re: Elaboration Question
Date: Fri, 2 Jan 2015 03:08:23 -0800 (PST)
Date: 2015-01-02T03:08:23-08:00 [thread overview]
Message-ID: <176076d0-ca97-46b5-8b6f-81e9289643c4@googlegroups.com> (raw)
In-Reply-To: <_3spw.995330$Fo3.305798@fx09.iad>
On Friday, January 2, 2015 8:49:15 AM UTC+1, Brad Moore wrote:
> No, that's definitely worse, and really doesn't fix anything. There is
> nothing preventing someone from attempting to reference A, before
> Initialize is called. Initializing during elaboration is safer also
> because it happens only once, and via the environment task. Relying on
> programmers to initialize globals via explicit calls is error prone, and
> can even lead to concurrency problems if Initialize is called from more
> than one place.
What strategy would you use when writing a library in Ada, that is to be called from e.g. a program written in C? In that case I think that using an initialization subprogram is the preferred method. If gprbuild is used to build the library, then a stand-alone library project can be used to ensure that the necessary elaboration code is called, but I have never used such a project type.
Regards,
Mark L
next prev parent reply other threads:[~2015-01-02 11:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 3:27 Elaboration Question Hubert
2015-01-02 7:56 ` Simon Wright
2015-01-02 22:16 ` Randy Brukardt
2015-01-02 14:49 ` Brad Moore
2015-01-02 11:08 ` Mark Lorenzen [this message]
2015-01-02 13:35 ` David Botton
2015-01-02 15:11 ` sbelmont700
2015-01-02 21:57 ` Niklas Holsti
2015-01-06 2:33 ` Randy Brukardt
2015-01-06 8:17 ` Niklas Holsti
2015-01-06 20:06 ` Randy Brukardt
2015-01-03 9:45 ` Jean François Martinez
2015-01-03 9:50 ` Hubert
2015-01-03 18:43 ` Jean François Martinez
2015-01-04 1:57 ` Hubert
2015-01-04 12:05 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox