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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Potential Coextension Bug in GNAT Date: Thu, 20 Dec 2018 20:16:09 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Fri, 21 Dec 2018 02:16:10 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="27902"; mail-complaints-to="news@jacob-sparre.dk" 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.7246 Xref: reader01.eternal-september.org comp.lang.ada:55092 Date: 2018-12-20T20:16:09-06:00 List-Id: "Simon Wright" wrote in message news:lyefacdtn8.fsf@pushface.org... > Jere writes: > >> I was messing around and trying to learn coextensions and >> I came across some counter intuitive functionality. If I >> directly initialize one via an aggregate, it works fine. >> However, if I initialize through a constructing function, >> it seems to treat the access discriminant as a normal access >> type and finalizes it at the end of the program instead of >> when the object leaves scope. > > Compiling with -gnatwa I see "warning: coextension will not be finalized > when its associated owner is deallocated or finalized", so GNAT clearly > meant to do it! This message is nonsense, because a coextension is effectively part of the associated object. What they presumably mean to say is that the declaration in question is *not* a coextension, thus it will not be finalized with the owner. Randy. P.S. I hate coextensions. One of the least necessary complications of Ada. (Janus/Ada gives you a "feature not implemented" message if you try to create one.)