From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1316 invoked by alias); 11 Jan 2013 08:07:56 -0000 Received: (qmail 1300 invoked by uid 22791); 11 Jan 2013 08:07:55 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Jan 2013 08:07:47 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MGG00900BPVZZ00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Fri, 11 Jan 2013 10:07:45 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MGG00907BWXR2B0@a-mtaout23.012.net.il>; Fri, 11 Jan 2013 10:07:45 +0200 (IST) Date: Fri, 11 Jan 2013 08:07:00 -0000 From: Eli Zaretskii Subject: Re: [obv] Make 'disable_display' static. In-reply-to: <1357870430-19757-1-git-send-email-yao@codesourcery.com> To: Yao Qi Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <838v80gn16.fsf@gnu.org> References: <1357870430-19757-1-git-send-email-yao@codesourcery.com> X-IsSubscribed: yes 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: 2013-01/txt/msg00213.txt.bz2 > From: Yao Qi > Date: Fri, 11 Jan 2013 10:13:50 +0800 > > disable_display is only called by disable_current_display in > printcmd.c, so we can make it static. I'll apply it in two days. Thanks. I'm not necessarily against this patch, but I have 2 questions to the forum: . why is it a good idea to go hunting for functions not used outside its source file and make them static? I don't see this requirement in any coding standards document pertinent to GDB. . if this is NOT mandated by any coding standards we try to enforce, why is this an "obvious" patch? The reason I'm asking is that, in general, whoever wrote that function could have judged it to be generally useful and export-worthy. IOW, its non-static type might be a result of deliberate design, not a historical accident (such as if it was initially static, then made extern because some other code, which no longer exists, needed it). Which one is the case in point, only an investigation into "cvs annotate" or "git annotate" can tell. If such an investigation _was_ in fact done, it would be a good idea to present it here. If it turns out that this function was extern from day one, then we should discuss whether it indeed is worthy of being exported, instead of defaulting to the "obvious" route based on its current users. P.S. This could be judged as bike-shedding, but if the issue is serious enough to make a patch, it is serious enough to discuss, IMO.