comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: Ada.Exceptions could be 'pragma Preelaborate' ?
Date: 1998/11/04
Date: 1998-11-04T00:00:00+00:00	[thread overview]
Message-ID: <71qcg3$mqi$1@nnrp1.dejanews.com> (raw)
In-Reply-To: gauthier-0411981349510001@cemrad.unilim.fr

In article <gauthier-0411981349510001@cemrad.unilim.fr>,
  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    




      reply	other threads:[~1998-11-04  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-30  0:00 Ada.Exceptions could be 'pragma Preelaborate' ? Stephen Leake
1998-10-30  0:00 ` Tucker Taft
1998-10-30  0:00 ` Robert A Duff
1998-10-31  0:00   ` dewar
1998-11-04  0:00   ` Michel Gauthier
1998-11-04  0:00     ` dewar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox