comp.lang.ada
 help / color / mirror / Atom feed
From: "Greg Bek" <gbek@bigpond.net.au>
Subject: Re: not handled exceptions
Date: Sat, 23 Mar 2002 00:42:23 GMT
Date: 2002-03-23T00:42:23+00:00	[thread overview]
Message-ID: <PbQm8.1149$EE4.1932@news-server.bigpond.net.au> (raw)
In-Reply-To: pan.2002.03.22.18.40.05.457489.4682@zamek.gda.pl

Your code is working properly.

In the first example there is no exception handler in the declarative region
where
the array is declared and the exception raised.

As for why it is hanging, the exception is being raised, there is no handler
at local
scope so the exception is propagating outwards looking for a handler.  I'm
guessing
it is reaching the outermost scope of your program and then it is up to the
runtime
system to properly deal with the situation.  Not sure why GNAT hangs.

Greg Bek


"Michal Nowikowski" <godfryd@zamek.gda.pl> wrote in message
news:pan.2002.03.22.18.40.05.457489.4682@zamek.gda.pl...
> Hello
>
> I've got problem with exceptions. It is my code:
>
> declare
>   D : Integer_Array_Access;
> begin
>   -- D is not allocated, so such call should raise
>   -- Constraint_Error exception:
>   D(3) := 5;
> end;
>
> but program does not throw exception instead it hangs.
> When I do:
>
> begin
>   D(3) := 5;
> exception
>   Constraint_Error =>
>      put_line("exception raised");
> end;
>
> the exception is raised and message is seen - program
> continue execution.
>
> I use Gnat 3.14 on Linux box. Have You any idea how to
> solve this problem?
>
> Best regards
> Godfryd
>
> --
> |  Michal Nowikowski <godfryd@zamek.gda.pl>
> |  BOFH excuse #360: Your parity check is overdrawn and you're out
> |  of cache.





  reply	other threads:[~2002-03-23  0:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-22 17:40 not handled exceptions Michal Nowikowski
2002-03-23  0:42 ` Greg Bek [this message]
2002-03-23  7:09 ` Wilhelm Spickermann
2002-03-23  9:36   ` Ingo Marks
2002-03-23 13:40   ` Michal Nowikowski
2002-03-23 11:52 ` Robert Dewar
2002-03-23 13:39   ` Michal Nowikowski
2002-03-23 15:13     ` Steve Doiel
2002-03-23 17:32       ` tmoran
2002-03-23 22:04       ` Michal Nowikowski
2002-03-23 23:37         ` Steve Doiel
2002-03-24  6:47           ` Michal Nowikowski
replies disabled

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