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: 103376,5d4ade2fd8fd67c6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!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:36:26 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <531193e0-3305-4292-9ed8-0176226c1d00@x12g2000yql.googlegroups.com> <1rx6dwrxmc81p.eazb4fjqztox$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1311381388 27458 69.95.181.76 (23 Jul 2011 00:36:28 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 23 Jul 2011 00:36:28 +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:21279 Date: 2011-07-22T19:36:26-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1rx6dwrxmc81p.eazb4fjqztox$.dlg@40tude.net... ... > There exist approaches to this: > > 1. The varying component can allocated outside the object. The object > would > keep a reference to it. This is the only approach that works for Ada (at least as far as I can tell). And it already works for Janus/Ada; we've used it as long as we've have discriminanted components (late 1980s). ... > I think that Ada should not try to support this stuff. Ada *does* support this stuff. As Adam noted, there are rules preventing the creation of accesses/renames of/into components that might change size. There also are rules supporting allocation/deallocation of objects that have multiple parts. So far as I know, those are the only rules needed to do so. And, as noted, Janus/Ada always has worked this way. I originally thought Ada compilers were expected to work this way, because there is no good reason not to support this as the default (as noted, some target environments might not want such objects, and pragma Restrictions can surely be used to prevent them from being generated). But apparently, implementers are lazy enough to avoid it, and customers have never pushed hard enough to get it added as an option. Randy.