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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6009c73a58f787a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-11 05:52:33 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.27.83.146!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: How to avoid unreferenced objects (mutexes etc) Date: Fri, 11 Jan 2002 13:52:25 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <3c3ee8c8.105408250@News.CIS.DFN.DE> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1010757145 13569 217.17.192.37 (11 Jan 2002 13:52:25 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 11 Jan 2002 13:52:25 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:18775 Date: 2002-01-11T13:52:25+00:00 List-Id: * Dmitry A. Kazakov wrote: >The problem is that the object Temp is never referenced. >The compiler complains of that, but it is a minor problem. You can use a compiler specific pragma to supress this warning. >The questions are > 1. Has the compiler right to optimize out Temp? No. There are initialisation and finalization actions which has to be taken. Other example "t : task_access := new task_type;" is also often "unused". > 2. Is there a better solution? That's a wonderful canoncical pattern.