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: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: AQ&S Guidance on pragma Elaborate_Body Date: 1997/04/21 Message-ID: <5jfukp$lda@top.mitre.org>#1/1 X-Deja-AN: 236367705 References: <528878564wnr@diphi.demon.co.uk> <5jabeq$3ltk@info4.rus.uni-stuttgart.de> Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Summary: purity prevents text_io Date: 1997-04-21T00:00:00+00:00 List-Id: Michael Paus asks > ... seems to be quite straight forward for the compiler to automatically > ... insert the highest level of purity. Are there any undesirable side > ... effects when doing that or is the rule not as simple as you said ? You cannot modify the body of a PURE package to add in, for example, text_io, or any other non-pure package for debugging purposes at a later time, without busting the purity of everything that withs the PURE package. You also may not reuse a pure generic package in a way that introduces any memory, because of the rule that the compiler may optimize away repeated calls with the same arguments. Gnat in its current state (3.07 DOS) optimizes pure packages that implement limited private data structures better than impure packages. ROMable code should be PURE. There text_io comment applies to preelaborate, since some debugging packages you may wish to introduce will be non-preelaborable. Reentrant code should be preelaborable, but the data section will not be PURE. There are no disadvantages to marking elaborable packages as ELABORATE_BODY, and they should be so marked for both documentation and for compiler hinting. The goal should be that almost all of the non-thread-safe code should be marked ELABORATE_BODY, and almost all of the thread-safe code should be marked PREELABORATE or PURE.