From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f9c25380ec58962 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.73.229 with SMTP id o5mr7735473pbv.7.1326724484902; Mon, 16 Jan 2012 06:34:44 -0800 (PST) Path: lh20ni188845pbb.0!nntp.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Elaboration circularity with generics Date: Mon, 16 Jan 2012 09:34:44 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <583b1bfe-95bd-4669-b16b-c733c81e8f88@w4g2000vbc.googlegroups.com> <1007811599348271064.048391rm-host.bauhaus-maps.arcor.de@news.arcor.de> <9e273746-1663-4fef-9154-f37a25d3c01b@o13g2000vbf.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1326724484 26174 192.74.137.71 (16 Jan 2012 14:34:44 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 16 Jan 2012 14:34:44 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Ugm9Rv3DASSGpbEpYwZw+RsU4oE= Content-Type: text/plain; charset=us-ascii Date: 2012-01-16T09:34:44-05:00 List-Id: Maciej Sobczak 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