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.224.93.19 with SMTP id t19mr4358943qam.3.1380208180049; Thu, 26 Sep 2013 08:09:40 -0700 (PDT) X-Received: by 10.182.105.133 with SMTP id gm5mr28474obb.38.1380208179988; Thu, 26 Sep 2013 08:09:39 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!d5no2031302qap.0!news-out.google.com!9ni338qaf.0!nntp.google.com!d5no2031294qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 26 Sep 2013 08:09:39 -0700 (PDT) In-Reply-To: <62fd156b-0be2-4465-aeba-287ec9ce22e0@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <62fd156b-0be2-4465-aeba-287ec9ce22e0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6aac88c1-beb4-478b-994f-4cc2eeaf2fdc@googlegroups.com> Subject: Re: Gnat's Handling of Record with Address Clause From: Adam Beneschan Injection-Date: Thu, 26 Sep 2013 15:09:40 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17299 Date: 2013-09-26T08:09:39-07:00 List-Id: On Thursday, September 26, 2013 7:23:36 AM UTC-7, Eryndlia Mavourneen wrote= : > 2) (also for Local_Buffer) >=20 > invalid address clause for initialized object "Local_Buffer" > reference to variable "Local_Buffer_Addr" not allowed (RM 13.1(22)) >=20 > I can understand (1), and I can initialize the record's discriminant, doi= ng away with this message; however, I do not understand that (2) says the r= ecord is initialized, unless it is some kind of default initialization. When two errors occur on the same line, you can't always trust all the mess= ages. As a compiler maintainer, my experience is that error recovery can b= e hard. Either the compiler just gives up and pretends the erroneous line = doesn't exist, which could lead to inappropriate error messages later on; o= r it tries to make some assumptions so that it can continue, but it's not a= lways going to do that perfectly. Plus, making sure that error messages ar= e totally accurate in a case like this is probably one of the lower priorit= ies of a compiler writer. If you do add a discriminant constraint, then the compiler must generate co= de to initialize the discriminant, so in that case the object *is* an initi= alized object. -- Adam