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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee1a8b8db84c88f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Wed, 17 Aug 2005 05:52:30 -0500 Newsgroups: comp.lang.ada Subject: Re: Ada exception block does NOT work? References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> <1124185355.610972.22710@f14g2000cwb.googlegroups.com> <9AnMe.418$zb.194@trndny03> From: Ludovic Brenta Date: Wed, 17 Aug 2005 12:53:37 +0200 Message-ID: <87hddou95a.fsf@tiscali.be> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:ZmnpVLrCaGieS6L467AHMEfADiw= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 83.134.243.54 X-Trace: sv3-7aLd9T+JnoDEgDhhunABGtWmDtiNC7ENo5RL/EW7eArATiNZ7LLlr+Cef9T8KsOcsKfI2ZyTNp0WJNu!nvBwJ0h79Lz2ex+HD/oJwydixh18bWrTLJcP3RpFcMUYtL0uNME4QWOTw9sSLJI= X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:4148 Date: 2005-08-17T12:53:37+02:00 List-Id: I tried to reduce the test case, but it works for me; the exception is raised and handled as many times as I want, and there is no infinite loop. with Ada.Exceptions; with Ada.Text_IO; procedure G is type T is delta 0.01 digits 18; type T_Array is array (Positive range <>) of T; procedure P (N : in T_Array) is A : T'Base; begin A := 10.0 / N'Length; exception when E: others => Ada.Text_IO.Put_Line ("Exception handled"); Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E)); end P; begin P ((1 .. 0 => 10.0)); P ((1 .. 0 => 10.0)); end G; $ gnatmake -g -gnatafno -gnatVa g -bargs -E cd /home/lbrenta/src/ada/ gnatmake -g -gnatafno -gnatVa trading -bargs -E gnatgcc -c -g -gnatafno -gnatVa trading.adb gnatbind -aO./ -E -I- -x trading.ali gnatlink -g trading.ali Compilation finished at Wed Aug 17 12:42:11 $ ./g Exception handled Exception name: CONSTRAINT_ERROR Message: SIGFPE Exception handled Exception name: CONSTRAINT_ERROR Message: SIGFPE Gautier's sample also shows no problem for me, the exception is indeed raised and handled three times, and there is no infinite loop. I used the same compiler options for both test cases. This is (you guessed it) on Debian GNU/Linux with gnat 3.15p-14; but as far back as 3.15p-7 it still works. I even tried AdaCore's binary distribution of GNAT, and it still works, even without any options. -- Ludovic Brenta.