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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,575dfcf6488662de X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Libraries written in Ada Date: Tue, 23 Nov 2004 12:38:57 +0100 Message-ID: <41A32151.5000705@mailinator.com> References: <18687975.p80OmDsB1I@linux1.krischik.com> <1464020.dFWPVBaaRG@linux1.krischik.com> <1966293.u6rVSTIjq0@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de /Dk66hYwzZr089ecEy2Hag6LO6wMnHQMaUWo/BRAhOmQIFiTs= User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:6369 Date: 2004-11-23T12:38:57+01:00 List-Id: Thomas Lotze wrote: > On Tue, 23 Nov 2004 10:48:45 +0100, Martin Krischik wrote: > > >>can be preelaborated by the compiler and then no runtime elaboration is >>needed. > > > How can I find out whether the code produced by the compiler (not a > specific one, but any compiler that conforms to the spec) needs runtime > elaboration? Are there simple rules such as "this code pattern may or does > require runtime elaboration while that pattern can be safely assumed to > work without"? I'd have to dig further through the references, but I > haven't found a clear statement so far. Look for the pragma No_Runtime if you're using Gnat. And look in the Ada Reference Manual for the pragmas Pure, Preelaborate & Elaborate_Body for elaboration concerns. I read these from time to time and always manage to forget the details ;) In particular, I'm not sure about the situation when your package can't have "preelaborate" and you don't specify an "elaborate_body". It's not the same (at least Gnat doesn't behave the same). And then there's that "elaborate" and "elaborate_all" which I suspect that apply in the previous case, but I never like to use. I don't like the package that uses another to have to worry about such pragmas, I prefer to have everything self-managed when possible. But maybe I'm confusing something. Finally you have that Gnat warning switch (that I don't remember now) which will warn you about elaboration order problems. Activating it late in a project will make you cry when you see the lots of "elaborate_all needed" it reports and you don't understand why :P Hint to adapower and adaworld :D : Set Up an explanation for the elaboration misteries of Ada in non-ARM speak.