From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66527 invoked by alias); 3 Feb 2016 16:05:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 66505 invoked by uid 89); 3 Feb 2016 16:05:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=H*M:56B0F2C2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 03 Feb 2016 16:05:52 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 44E6E96DE; Wed, 3 Feb 2016 16:05:51 +0000 (UTC) Received: from [10.10.116.46] (ovpn-116-46.rdu2.redhat.com [10.10.116.46]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13G5l4t016104; Wed, 3 Feb 2016 11:05:50 -0500 Subject: Re: [C++ PATCH] Fix -Wunused-function (PR debug/66869) To: Jakub Jelinek References: <20160125203829.GP3017@tucnak.redhat.com> <20160126161813.GB3017@tucnak.redhat.com> <20160127185159.GT3017@tucnak.redhat.com> <56A91A7A.3060700@redhat.com> <20160128201506.GG3017@tucnak.redhat.com> <56AAD3B6.2060804@redhat.com> <20160129103507.GM3017@tucnak.redhat.com> <20160129123051.GN22971@tucnak.redhat.com> Cc: Richard Biener , "Joseph S. Myers" , Marek Polacek , Jan Hubicka , GCC Patches From: Jason Merrill Message-ID: <56B0F2C2.5040505@redhat.com> Date: Wed, 03 Feb 2016 16:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160129123051.GN22971@tucnak.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00199.txt.bz2 On 01/29/2016 01:30 PM, Jakub Jelinek wrote: > On Fri, Jan 29, 2016 at 11:35:07AM +0100, Jakub Jelinek wrote: >> I can try to stick there an assert whether for FUNCTION_DECL >> (DECL_INITIAL (decl) == 0) == DECL_EXTERNAL (decl). > > Tried that, but cancelled that quickly, I see lots of cases where > DECL_INITIAL is non-NULL, but DECL_EXTERNAL is set, and some > where DECL_INITIAL is NULL, and DECL_EXTERNAL is not set, > at least in the other two spots (check_global_declaration in cgraphunit.c > and c-decl.c). Haven't waited long enough to find out if the C++ FE is some > exception. My thought was that if DECL_INITIAL is non-null, the function is defined, so it seems odd to warn about a lack of definition. Jason