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,cf75272301f10c97 X-Google-Attributes: gid103376,public From: dewar@gnat.com Subject: Re: Ada.Exceptions could be 'pragma Preelaborate' ? Date: 1998/11/04 Message-ID: <71qcg3$mqi$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 408397171 References: X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Nov 04 20:12:51 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-11-04T00:00:00+00:00 List-Id: In article , gauthier@alphainfo.unilim.fr (Michel Gauthier) wrote: Couldn't designers envisage a Pure or Preelaborate Ada.Exceptions declaring > at least Exception_Id and Raise_Exception, and a non-Preelaborate child ? > > It is really harmful to depend on a non-Preelaborate unit when the only > need is to attach a message to a raise. It is more important than simply > 'nice to have'. > > In some cases, I worked around the problem with a basic package containing > raises with messages, with two bodies Pure (messages are ignored) versus > Raise_Exception. Pragmas have to be set or reset by editor macros. Note that at least some of the time, people use pragma Preelaborate to avoid the presence of elaboration code. Unfortunately, this pragma has not much too do with this avoidance. There can be code with pragma Preelaborate that has elaboration code, and code that is inconsistent with pragma Preelaborate that has no elaboration code. We have found it helpful to introduce in GNAT a new implementation dependent restriction, pragma Restriction (No_Elaboration_Code) that requires that a given unit (it is a configuration pragma that can apply to selected units) may not generate any elaboration code. Note that, unlike pragma Preelaborate, this restriction pragma does not necessarily apply to with'ed units etc. Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own