comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Elaboration circularity with generics
Date: Mon, 16 Jan 2012 09:34:44 -0500
Date: 2012-01-16T09:34:44-05:00	[thread overview]
Message-ID: <wccd3ajaf7f.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 9e273746-1663-4fef-9154-f37a25d3c01b@o13g2000vbf.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> writes:

> Does it mean that the compiler can refuse legal code just because its
> internal algorithm is biased?
> As I understand, there is no language-related reason for the
> circularity. That is, there is no ARM paragraph that would say that in
> this particular program there will be a cyclic elaboration dependency
> (otherwise I would appreciate some pointers).

By default, GNAT uses a static elaboration model.  This is a
non-standard mode -- it does not follow the rules in the Ada RM.
If you want the standard mode, you have to turn it on explicitly.

I suggest you read the section about elaboration in the gnat
docs -- it's rather long, but it should explain everything.

One advantage of the static elaboration model is that you
don't get any run-time elaboration checks.  Another is that
you don't need to put elaboration control pragmas all
over the place.  (On rare occassions, you might need one.)
But the static elaboration model is (necessarily) more
restrictive in that it will disallow certain cases that
are allowed by the standard (dynamic) model.

> In such a case I would consider it to be a compiler bug.

I don't see any compiler bug here.

I see some Ada language-design bugs, though.  ;-)

- Bob



  parent reply	other threads:[~2012-01-16 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 15:09 Elaboration circularity with generics Maciej Sobczak
2012-01-14 16:13 ` Martin Dowie
2012-01-14 16:17 ` AdaMagica
2012-01-14 22:46   ` Simon Wright
2012-01-15 16:55     ` AdaMagica
2012-01-16 15:09       ` Simon Wright
2012-01-16 17:15         ` AdaMagica
2012-01-14 16:26 ` AdaMagica
2012-01-14 22:01 ` Georg Bauhaus
2012-01-15 17:15   ` Maciej Sobczak
2012-01-15 17:43     ` AdaMagica
2012-01-16 17:02       ` Adam Beneschan
2012-01-16 14:34     ` Robert A Duff [this message]
2012-01-16 21:29       ` Maciej Sobczak
2012-01-16 21:52         ` Adam Beneschan
2012-01-16 22:25         ` Robert A Duff
replies disabled

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