comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: C++ to Ada95 -- bitten!
Date: Sun, 10 Sep 2000 15:47:33 GMT
Date: 2000-09-10T15:47:33+00:00	[thread overview]
Message-ID: <8pgaeg$kps$1@nnrp1.deja.com> (raw)
In-Reply-To: 867l8kelvx.fsf@acm.org

In article <867l8kelvx.fsf@acm.org>,
  Laurent Guerby <guerby@acm.org> wrote:
> "Nick J Chackowsky" <nick@arcticmail.com> writes:
> > Ahaaaa... the _compiler_ attempted to "solve" the poorly
formed exponent and
> > crashed in the attempt?

Actually the compiler did not crash, it complained it was
out of memory (Storage_Error raised during compilation), and
indeed that's likely what is going on, since computing that
rather large number absolutely precisely (as required by
the standard since it is a static expression), requires a huge
amount of memory. GNAT does not particularly try to optimize
this kind of case since it is unlikely to occur in correct
programs :-)

A general note is that if you get a Storage_Error, and you
know what caused it (GNAT certainly tells you where you were
in the source), then it is worth checking for this case. Even
if GNAT were to improve its storage efficiency in handling
large expressions, it is always possible (and in fact pretty)
easy, to write ones that will require arbitrary amounts of
memory (and computing power -- absurd static expressions can
also appear to put a compiler into an infinite loop!)




Sent via Deja.com http://www.deja.com/
Before you buy.



      reply	other threads:[~2000-09-10 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-10  1:24 C++ to Ada95 -- bitten! Nick J Chackowsky
2000-09-10  2:28 ` Al Christians
2000-09-10  3:07 ` (null)
2000-09-10  4:49   ` Nick J Chackowsky
2000-09-10  7:39     ` Laurent Guerby
2000-09-10 15:47       ` Robert 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