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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.74.5 with SMTP id k5mr13913562itb.30.1516153328118; Tue, 16 Jan 2018 17:42:08 -0800 (PST) X-Received: by 10.157.90.130 with SMTP id w2mr10576oth.14.1516153327899; Tue, 16 Jan 2018 17:42:07 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!w142no2307211ita.0!news-out.google.com!s63ni6531itb.0!nntp.google.com!g80no2770953itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 16 Jan 2018 17:42:07 -0800 (PST) In-Reply-To: <14a35359-150a-4aa6-b437-19c74381be4b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.39; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.39 References: <14a35359-150a-4aa6-b437-19c74381be4b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: strange length check error From: Anh Vo Injection-Date: Wed, 17 Jan 2018 01:42:08 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2852135260 X-Received-Bytes: 2106 Xref: reader02.eternal-september.org comp.lang.ada:49949 Date: 2018-01-16T17:42:07-08:00 List-Id: On Tuesday, January 16, 2018 at 12:48:45 PM UTC-8, Mehdi Saada wrote: > This : Put(Ch_Bounded1 & ' ' ); > Calls on that: > function "&" > (Left : in Bounded_String; > Right : in Character) > return Bounded_String > is > begin > if LENGTH(LEFT) + 1 > MAX_LENGTH then > raise LENGTH_ERROR with "ERROR '&': LEFT.LENGTH := " & NATURAL'IMAGE(LENGTH(LEFT)) & " + 1 > MAX_LENGTH"; > else > @@@ return (LENGTH(LEFT) + 1, LEFT.DATA(1..LENGTH(LEFT)) & RIGHT); > end if; > end "&"; > > The line with @@@ raises this: > raised CONSTRAINT_ERROR : p_bounded_g-p_new_bounded_g.adb:34 length check failed > The value of CH_BOUNDED1 at that moment is "pour tester le debut", its length is 21, and MAX_LENGTH est 80. What is Bounded_String?