Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.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 11:32:00 -0000	[thread overview]
Message-ID: <20130111113244.GL6143@adacore.com> (raw)
In-Reply-To: <838v80gn16.fsf@gnu.org>

>   . 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.

I think it is a good idea, because it helps us (developers) a lot
when we see that a variable or function is static, and thus only
referenced within the unit.

It also helps the compiler, because it is now able to notify us
when a symbol is no longer referenced, and thus a candidate
for deletion. Without making them "static", we don't get the
compiler warning.

More generally, I think that everything should be static/const
by default, and anything that is not needs to explained (when
not obvious, or course).

>   . if this is NOT mandated by any coding standards we try to enforce,
>     why is this an "obvious" patch?

I do not necessarily consider these patches obvious, because
I've seen emails on this list suggesting that we seem to be flexible
with uncontributed code which might be needing the symbol to
be exported rather than static.  But I think that they generally
go in the right direction and should be encouraged.

-- 
Joel


  parent reply	other threads:[~2013-01-11 11:32 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 [this message]
2013-01-11 14:39   ` Tom Tromey
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=20130111113244.GL6143@adacore.com \
    --to=brobecker@adacore.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