From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18664 invoked by alias); 4 May 2012 09:10:15 -0000 Received: (qmail 18639 invoked by uid 22791); 4 May 2012 09:10:13 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 May 2012 09:09:59 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SQEWU-00000L-99 from Maciej_Rozycki@mentor.com ; Fri, 04 May 2012 02:09:58 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 4 May 2012 02:09:51 -0700 Received: from [172.30.14.29] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Fri, 4 May 2012 10:09:56 +0100 Date: Fri, 04 May 2012 09:10:00 -0000 From: "Maciej W. Rozycki" To: Joel Brobecker CC: Subject: Re: [RFA/commit] procfs.c: Remove unused functions and make many functions static In-Reply-To: <1336000479-30511-1-git-send-email-brobecker@adacore.com> Message-ID: References: <1336000479-30511-1-git-send-email-brobecker@adacore.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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 X-SW-Source: 2012-05/txt/msg00122.txt.bz2 On Thu, 3 May 2012, Joel Brobecker wrote: > This is something that was triggered after seeing a patch silencing > some -Wmissing-prototypes errors in procfs.c. The diff made me wonder > about why we had so many non-static functions in procfs.c. Turns out > most of them can actually be static. > > This patches the functions that can be static into static functions. > It removes advances declarations when unnecessary. > > And it also delete unused functions... I hesitated doing that in the change you must obviously have in mind because it appeared to me that this source file wants to present a complete API to /proc services, even if some parts are not actually (currently) used by GDB (but may be or may have been sometime). Hence all the unused functions have prototypes and are defined with external linkage or GCC (and possibly some other compilers) would have complained about them long ago, before -Wmissing-prototypes was added. What is unclear to me of course is whether the availability of the complete API (if my perception is indeed correct) is relevant any longer and why the prototypes have never been moved to a header clients could use. The file is very old: Thu Oct 24 01:32:51 1991 Fred Fish (fnf at cygnus.com) * procfs.c: New file for SVR4 /proc (process file system) support. and a corresponding header was not added back then even though it had clients (a common practice once, sigh, for any client to use its own locally provided prototypes or even rely on default declarations). Maciej