From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Rod Kay Newsgroups: comp.lang.ada Subject: Re: Extra information in the message string of exceptions. Date: Thu, 27 Oct 2022 22:56:45 +1100 Organization: A noiseless patient Spider Message-ID: References: <3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com> <574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 27 Oct 2022 11:56:42 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="1312f7afe70cd3c46502295dfb19cb0c"; logging-data="2905682"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rpFHUrRRF7uAnrdOm+WoLmRBXSsG5F2o=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Cancel-Lock: sha1:yHJva8rD2rwt9KvYC73uGsMzMMM= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64563 List-Id: On 8/6/22 19:08, Dmitry A. Kazakov wrote: > On 2022-06-08 09:31, Jerry wrote: > >> But has no effect on this program; >> >> procedure CE_2 is >>      i : Positive; >>      j : Integer := 1; >> begin >>      i := -j; >> end CE_2; > > I noticed that it requires a user-defined [sub]type AND nested subprogram: > >    procedure Test (A : Integer) is >       subtype T is Integer range 0 .. 42; >       i : T; >    begin >       i := A; -- This will work >    end; > begin >    Test (-1); > Are you sure about this ? I tried ... procedure Example is X : Positive := 5; begin loop X := X - 1; end loop; end Example; ... with the -gnateE and saw this result ... [rod@orth example]$ ./example raised CONSTRAINT_ERROR : example.adb:6:14 range check failed value 0 not in 1..2147483647 [./example] 0x55916975377f Example at example.adb:6 0x559169753b74 Main at b__example.adb:193 [/usr/lib/libc.so.6] 0x7f9230be728e 0x7f9230be7348 [./example] 0x559169753623 _start at start.S:115 0xfffffffffffffffe