From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Yao Qi <yao@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [obv] Make 'disable_display' static.
Date: Fri, 11 Jan 2013 14:39:00 -0000 [thread overview]
Message-ID: <87d2xbu6l3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <838v80gn16.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Jan 2013 10:08:05 +0200")
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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
next prev parent reply other threads:[~2013-01-11 14:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 2:14 Yao Qi
2013-01-11 8:07 ` Eli Zaretskii
2013-01-11 8:51 ` Yao Qi
2013-01-11 10:22 ` Eli Zaretskii
2013-01-11 11:32 ` Joel Brobecker
2013-01-11 14:39 ` Tom Tromey [this message]
2013-01-11 15:01 ` Pedro Alves
2013-01-11 15:27 ` Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d2xbu6l3.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox