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 t19mr4404908qam.3.1380208894937; Thu, 26 Sep 2013 08:21:34 -0700 (PDT) X-Received: by 10.182.231.227 with SMTP id tj3mr28716obc.40.1380208894887; Thu, 26 Sep 2013 08:21:34 -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!d5no2032674qap.0!news-out.google.com!9ni338qaf.0!nntp.google.com!d5no2032664qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 26 Sep 2013 08:21:34 -0700 (PDT) In-Reply-To: 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> <8b2c53f7-9018-4817-82a7-c93835c3866c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <78f1eefc-8289-4afc-80c6-04aec1f26b7e@googlegroups.com> Subject: Re: Gnat's Handling of Record with Address Clause From: Adam Beneschan Injection-Date: Thu, 26 Sep 2013 15:21:34 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17300 Date: 2013-09-26T08:21:34-07:00 List-Id: On Thursday, September 26, 2013 8:05:17 AM UTC-7, Eryndlia Mavourneen wrote= : > Since the "Message" parameter is an address, I assume that you mean decla= ring an access type for My_Buffer_T, then doing the address -> access conve= rsion for an access variable on that type. =20 Yes. > A lot of work to get around this Gnat issue. =20 I think using System.Access_To_Address_Conversions is the right way to do i= t, regardless of whose compiler you're using. Using an Address aspect on a= discriminant record type like this is going to be problematic, without a s= pecific language feature to support it. As you found out, the language doe= sn't let you declare objects of indefinite types without specifying the con= straints, even if you have an Address aspect; but if you do specify the dis= criminant constraint, what do you put for the constraint, given that the co= rrect value will be something that has to be read from memory? So there ar= e language design issues involved with using Address on a discriminant reco= rd; it's not really a GNAT issue. Even on a non-discriminant record, there= are potential problems with the Address aspect because record fields that = have implicit initializers are still going to be initialized, unless there'= s also an Import aspect. (See AARM 13.3(12.d/3).) =20 So on balance, it's probably right in general to use System.Address_To_Acce= ss_Conversions instead of Address aspects. -- Adam