From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19566 invoked by alias); 11 Jan 2013 14:39:54 -0000 Received: (qmail 19496 invoked by uid 22791); 11 Jan 2013 14:39:53 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Jan 2013 14:39:41 +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 (8.14.4/8.14.4) with ESMTP id r0BEdc4u010643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jan 2013 09:39:39 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0BEdaNv006736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 11 Jan 2013 09:39:38 -0500 From: Tom Tromey To: Eli Zaretskii Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [obv] Make 'disable_display' static. References: <1357870430-19757-1-git-send-email-yao@codesourcery.com> <838v80gn16.fsf@gnu.org> Date: Fri, 11 Jan 2013 14:39:00 -0000 In-Reply-To: <838v80gn16.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Jan 2013 10:08:05 +0200") Message-ID: <87d2xbu6l3.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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/msg00219.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> . why is it a good idea to go hunting for functions not used outside Eli> its source file and make them static? I don't see this Eli> requirement in any coding standards document pertinent to GDB. I don't hunt for these but I sometimes trip across them by accident. Eli> . if this is NOT mandated by any coding standards we try to enforce, Eli> why is this an "obvious" patch? In general the less scope an object has, the simpler it is to reason about it. The "static" indicates immediately that it is private to the file. Eli> The reason I'm asking is that, in general, whoever wrote that function Eli> could have judged it to be generally useful and export-worthy. It's trivial to re-export an object should the need arise. In fact I think it is better to have the discussion around exporting objects than around making them static. The default ought to be static, as much as possible, to reduce the size of a module's API. Tom