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!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Legit Warnings or not Date: Sat, 23 Jul 2011 10:32:41 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <531193e0-3305-4292-9ed8-0176226c1d00@x12g2000yql.googlegroups.com> <1rx6dwrxmc81p.eazb4fjqztox$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1311431561 1852 192.74.137.71 (23 Jul 2011 14:32:41 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 23 Jul 2011 14:32:41 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:PcNsr8Jh/2Zu+QOjVfHxwIGnO/s= Xref: g2news2.google.com comp.lang.ada:21295 Date: 2011-07-23T10:32:41-04:00 List-Id: "Randy Brukardt" writes: > 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. Right, but those rules are necessary for the allocate-the-max implementation, too -- otherwise you can have dangling pointers. So I don't think the existence of these rules gives us any clue as to what was the intent of the original designers. > 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, You may be right about that. I wonder if there's anything in the Ada 83 Rationale that would tell us. (On another topic, it's pretty clear to me that the original designers thought garbage collection should and would be supported.) >...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. I don't think it was laziness. It was an honest belief that implicit heap allocation is evil. - Bob