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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.224.230 with SMTP id rf6mr3542686pbc.4.1330554220739; Wed, 29 Feb 2012 14:23:40 -0800 (PST) Path: h9ni24415pbe.0!nntp.google.com!news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Wed, 29 Feb 2012 17:23:37 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> <17412419.40.1330534213855.JavaMail.geo-discussion-forums@vbva11> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1330554220 975 192.74.137.71 (29 Feb 2012 22:23:39 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 29 Feb 2012 22:23:39 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ncV/goNi7d0SGLq+f/OHvYKsh8g= Content-Type: text/plain; charset=us-ascii Date: 2012-02-29T17:23:37-05:00 List-Id: Simon Wright writes: > I know that GNAT is a work-in-progress, but it doesn't raise C_E with > GNAT GPL 2011. Did you turn on assertions? They're off by default in GNAT. You need to use a switch or a pragma. It works with the latest GNAT Pro. But this shows I was wrong when I said it raises Constraint_Error. I momentarily forgot that it raises Assert_Failure. Some folks think it should raise Constraint_Error, and Ada 2012 isn't quite finished, so... % gnatmake -f -gnata -gnat2012 array_test.adb gcc -c -gnata -gnat2012 array_test.adb gnatbind -x array_test.ali gnatlink array_test.ali % ./array_test raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : predicate failed at array_test.adb:14 % cat array_test.adb procedure Array_Test is type Integer_Array is array (Positive range <>) of Integer with Dynamic_Predicate => Integer_Array'First = 1; procedure Foo (Param : in out Integer_Array) is begin null; end Foo; A : Integer_Array (1 .. 10) := (others => 0); begin Foo (A (3 .. 8)); end Array_Test; % - Bob