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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.103.138 with SMTP id fw10mr2074390obb.47.1459930761578; Wed, 06 Apr 2016 01:19:21 -0700 (PDT) X-Received: by 10.157.62.183 with SMTP id b52mr446993otc.1.1459930761541; Wed, 06 Apr 2016 01:19:21 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!nt3no8211877igb.0!news-out.google.com!ha2ni184igb.0!nntp.google.com!nt3no8211873igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Apr 2016 01:19:21 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:120b:7f3:dcd0:64aa:9bd2:6ac4:5f7c; posting-account=DQbqYQoAAACn8hHn2LmG2aF7Mhbxl_Lf NNTP-Posting-Host: 2a02:120b:7f3:dcd0:64aa:9bd2:6ac4:5f7c References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <70a76f87-51a9-4e77-9fa0-79714f9c0ba7@googlegroups.com> Subject: Re: Uninitialized out parameters. From: ahlan@marriott.org Injection-Date: Wed, 06 Apr 2016 08:19:21 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30003 Date: 2016-04-06T01:19:21-07:00 List-Id: On Tuesday, April 5, 2016 at 6:19:47 PM UTC+2, G.B. wrote: > On 05.04.16 14:02, ahlan@marriott.org wrote: > > Ada.Text_IO.Put_Line ("V:" & V'img); > > > > The value zero is output, which because V is positive should be impossible. > > Addressing just this issue: the line is calling > implementation defined attribute 'IMG, which can > do as it pleases. The Ada type attribute 'Image > takes a value of type Positive'Base, which includes 0, > which is why outputting 0 is perfectly fine. > > (It's not a subtype attribute, but a type attribute, > if this makes sense.) The issue here is not whether or not 'img fails but the fact that V is returned with a value out of range. But even that is not the point I'm trying to make. I am suggesting that it ought not to be possible to define a null procedure that has out parameters without some form of warning being issued.