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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5d4ade2fd8fd67c6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!easy.in-chemnitz.de!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Legit Warnings or not Date: Fri, 22 Jul 2011 19:31:08 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <531193e0-3305-4292-9ed8-0176226c1d00@x12g2000yql.googlegroups.com> <3e8384ce-e18a-4d84-95d7-f4eb750b16c9@u6g2000prc.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1311381072 27057 69.95.181.76 (23 Jul 2011 00:31:12 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 23 Jul 2011 00:31:12 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Xref: g2news2.google.com comp.lang.ada:21278 Date: 2011-07-22T19:31:08-05:00 List-Id: "Adam Beneschan" wrote in message news:b760b2c4-b774-43b6-b29e-4882470be1f4@a2g2000prf.googlegroups.com... >On Jul 21, 8:41 am, Robert A Duff >wrote: >> Adam Beneschan writes: >> > You don't have to allocate a whole new Warned_Person, just a new Name. >> >> Right. If you allocate a whole new Warned_Person, you can get >> dangling pointers and dangling renamings. If I remember correctly, >> the rules prevent renaming or 'Access of parts of Name (assuming >> it has aliased parts). > >3.10.2(26), 8.5.1(5). However, I think the language now says that >'Access and rename of a component are OK if the discriminated object >is known to be constrained; that means that the implementation has to >be smart enough to know that it can't allocate a new Name in that case >(when the entire record is assigned) but keep the same pointer and >just copy over the data that it points to. That's a good idea anyway, just because allocating and deallocating memory is expensive. We do that any time the component does not change size - which has the side-effect of working in any case that would be allowed by the mentioned rules. Randy. -- Adam