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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,555115ba813101ad X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: Finalization of package instance Date: 2000/01/19 Message-ID: <3884FB44.CFBE17A2@earthlink.net>#1/1 X-Deja-AN: 574498714 Content-Transfer-Encoding: 7bit References: <388496B3.7E36F781@earthlink.net> <9l4h4.5569$Wn2.114954@newsread2.prod.itd.earthlink.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Tue Jan 18 17:46:45 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 948246405 38.29.66.196 (Tue, 18 Jan 2000 17:46:45 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Tue, 18 Jan 2000 17:46:45 PST Newsgroups: comp.lang.ada Date: 2000-01-19T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > In article <388496B3.7E36F781@earthlink.net> , Jeff Carter > wrote: > > > 3. In the body of Datalink, declare a controlled type and an object of > > that type; the Finalize for the type does the disconnect. > > This is the simplest of your solutions. I forgot to mention that the solution with the visible type requires that the Initialize procedure for the type do the connect. Sorry. > > > Datalink would > > be generic, so each instance would have its own controlled object. This > > can get you into trouble because a compiler may optimize away an unused > > variable. > > I think there's a new rule (I don't know the AI) that says a > Limited_Controlled object cannot be optimized away. > > This issue has come up on CLA before; visit DejaNews to find the thread. I recall the thread, with the information that an unused controlled type could be optimized away, but that GNAT doesn't. If there's a new AI preventing it in general, that's good news. -- Jeff Carter "English bed-wetting types." Monty Python & the Holy Grail