From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10884 invoked by alias); 9 Jan 2020 18:46:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10873 invoked by uid 89); 9 Jan 2020 18:46:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:sk:client-, D*FreeBSD.org, mute, H*r:sk:server- X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (96.47.72.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jan 2020 18:46:37 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id DFB2290EC6; Thu, 9 Jan 2020 18:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tw7b48DZz4Xn5; Thu, 9 Jan 2020 18:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-7.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3D24317945; Thu, 9 Jan 2020 18:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH 01/15] Add back declarations for _initialize functions To: Simon Marchi , gdb-patches@sourceware.org References: <20191125052655.22696-1-simon.marchi@efficios.com> <20191125052655.22696-2-simon.marchi@efficios.com> From: John Baldwin Openpgp: preference=signencrypt Message-ID: Date: Thu, 09 Jan 2020 18:46:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191125052655.22696-2-simon.marchi@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00215.txt.bz2 On 11/24/19 9:26 PM, Simon Marchi wrote: > I'd like to enable the -Wmissing-declarations warning. However, it > warns for every _initialize function, for example: > > CXX dcache.o > /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’: > /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations] > _initialize_dcache (void) > ^~~~~~~~~~~~~~~~~~ > > The only practical way forward I found is to add back the declarations, > which were removed by this commit: > > commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 > Author: John Baldwin > Date: Sat Sep 9 11:02:37 2017 -0700 > > Remove unnecessary function prototypes. > > I don't think it's a big problem to have the declarations for these > functions, but if anybody has a better solution for this, I'll be happy > to use it. (Sorry for the late reply, but I don't think I've seen this pushed in yet?) I don't have a better solution. I feel like clang warned about the declarations perhaps, but I can't find the reason for making this change in the old branch. It might be worth testing a build with clang to see if this adds new warnings there or not. I can help with doing that if needed. If it does trigger a warning on clang we might also just choose to mute that warning (I think since the original commit we have added the ability to have clang- and gcc-specific warning flags). -- John Baldwin