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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,baa6871d466e5af9 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: AQ&S Guidance on pragma Elaborate_Body Date: 1997/04/21 Message-ID: #1/1 X-Deja-AN: 236491181 References: <528878564wnr@diphi.demon.co.uk> <5jabeq$3ltk@info4.rus.uni-stuttgart.de> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-21T00:00:00+00:00 List-Id: Robert Duff said <> No, that's quite wrong. There are many things that can place restrictions on the order of elaboration. Suppose we have a package Glorp that has several procedures including Thunk, Boggle, and Glub. In the comments of package Glorp, we find the comment: -- WARNING: It is essential to call Thunk before calling Boggle. If you -- fail to do this, all subsequent calls to Glub will raise the Glob-Glob -- exception or otherwise malfunction. Clients of Glorp are responsible for -- obeying this rule, since no check is made (a check would introduce too -- much overhead). Now, suppose we have two clients of Glorp, Jabber and Wocky. The elaboration code of Jabber calls Thunk, and the elaboration code of Wocky calls Boggle. Well now it is essential that Jabber is elaborated before Wocky, and no static analysis of the program code can determine this, and a pragma Elaborate is required. And if you think this is just theoretical, think again, there are instantiations of the names above in the SGI GNAT runtime library, and when we installed some new clever elaboration stuff (a bit like Bob proposes, but more effective, and easier to understand), the binder chose a much better elaboration order, much more clearly guaranteed to prevent Program_Error, but unfortunately wrong (of course this is a bug in the runtime, there is a missing pragma Elaborate). It is quite true that you can guarantee absence from Program_Error for a wide variety of programs automatically, and version 3.10 of GNAT does that. BUT it is far from true that this means that you could "dispense with all elaboration-control pragmas".