From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16010 invoked by alias); 15 Dec 2004 17:34:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5245 invoked from network); 15 Dec 2004 17:25:13 -0000 Received: from unknown (HELO nile.gnat.com) (205.232.38.5) by sourceware.org with SMTP; 15 Dec 2004 17:25:13 -0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id B2D759617; Wed, 15 Dec 2004 12:25:12 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 17862-01-10; Wed, 15 Dec 2004 12:25:12 -0500 (EST) Received: from [127.0.0.1] (taconic.gnat.com [205.232.38.103]) by nile.gnat.com (Postfix) with ESMTP id 78D8A9616; Wed, 15 Dec 2004 12:25:12 -0500 (EST) Message-ID: <41C0737C.5010001@adacore.com> Date: Wed, 15 Dec 2004 17:34:00 -0000 From: Robert Dewar User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: Florian Weimer Cc: Dmitry Antipov , gcc@gcc.gnu.org Subject: Re: Dubious "'foo' might be used uninitialized in this function" message References: <41BF1207.2040102@dev.rtsoft.ru> <41BF1C0A.6060100@codesourcery.com> <41C009AA.4020700@dev.rtsoft.ru> <41C0289C.2000209@adacore.com> <87sm677a1y.fsf@deneb.enyo.de> In-Reply-To: <87sm677a1y.fsf@deneb.enyo.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00592.txt.bz2 Florian Weimer wrote: > * Robert Dewar: > > >>Here is an example from Ada: >> >> 1. generic >> 2. type R is private; >> | >> >>> warning: type "R" is not referenced >> >> 3. package Q is >> 4. X : Integer; >> 5. end Q; >> >>One of our customers recently complained that this was a false >>positive, because there might be a child unit of Q that references >>R. This is true. However, after quite a bit of dicussion, we >>decided that it was useful to retain the warning, since it is >>rather unusual (though certainly legal) to have entities that >>are referenced ONLY in a child unit, and if we removed the >>warning on this basis, we would lose a lot of useful warnings. > > > In this case, pragma Unreferenced could be specified in the body of > the parant unit, and it could do the right thing. first of all, there is no body of the parent unit in this case. Second of all, pragma Unreferenced means you have something that is not referenced anywhere. So this does not help in this case. Indeed the "bug" report was precisely that pragma unreferenced does not work :-)