git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Fix various sparse warnings in the git source code
Date: Thu, 18 Jun 2009 14:48:29 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0906181445530.16802@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.01.0906181021520.16802@localhost.localdomain>



On Thu, 18 Jun 2009, Linus Torvalds wrote:
> 
>  - warning: symbol 'xyz' was not declared. Should it be static?
> 
>    Sparse wants to see declarations for any functions you export. A lack 
>    of a declaration tends to mean that you should either add one, or you 
>    should mark the function 'static' to show that it's in file scope. 
> 
>    A few of these remain: I only did the ones that should obviously just 
>    be made static.

I don't know why I missed a couple.

That 'wt_status_submodule_summary' one is debatable. It has a few related 
flags (like 'wt_status_use_color') which _are_ declared, and are used by 
builtin-commit.c. So maybe we'd like to export it at some point, but it's 
not declared now, and not used outside of that file, so 'static' it is in 
this patch.

		Linus

---
 http-push.c    |    2 +-
 unpack-trees.c |    2 +-
 wt-status.c    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/http-push.c b/http-push.c
index e4ea395..8cc8ee0 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1750,7 +1750,7 @@ static int delete_remote_branch(char *pattern, int force)
 	return 0;
 }
 
-void run_request_queue(void)
+static void run_request_queue(void)
 {
 #ifdef USE_CURL_MULTI
 	is_running_queue = 1;
diff --git a/unpack-trees.c b/unpack-trees.c
index ac9927f..1958319 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -140,7 +140,7 @@ static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_option
 	return call_unpack_fn(src, o);
 }
 
-int traverse_trees_recursive(int n, unsigned long dirmask, unsigned long df_conflicts, struct name_entry *names, struct traverse_info *info)
+static int traverse_trees_recursive(int n, unsigned long dirmask, unsigned long df_conflicts, struct name_entry *names, struct traverse_info *info)
 {
 	int i;
 	struct tree_desc t[MAX_UNPACK_TREES];
diff --git a/wt-status.c b/wt-status.c
index 24a6abf..47735d8 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -13,7 +13,7 @@
 
 int wt_status_relative_paths = 1;
 int wt_status_use_color = -1;
-int wt_status_submodule_summary;
+static int wt_status_submodule_summary;
 static char wt_status_colors[][COLOR_MAXLEN] = {
 	GIT_COLOR_NORMAL, /* WT_STATUS_HEADER */
 	GIT_COLOR_GREEN,  /* WT_STATUS_UPDATED */

  parent reply	other threads:[~2009-06-18 21:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 20:03 [PATCH] Cast things properly to handle >2G files Alfred M. Szmidt
2009-06-14 20:17 ` Johannes Schindelin
2009-06-15  2:43   ` Nicolas Pitre
2009-06-15  3:39   ` Alfred M. Szmidt
2009-06-15  4:06     ` Junio C Hamano
2009-06-15  8:45       ` Johannes Schindelin
2009-06-15  4:25     ` Linus Torvalds
2009-06-17 22:27       ` Alfred M. Szmidt
2009-06-17 22:48         ` Linus Torvalds
2009-06-17 22:27       ` Alfred M. Szmidt
2009-06-17 22:45         ` Linus Torvalds
2009-06-17 23:16           ` Junio C Hamano
2009-06-18  0:22           ` Fix big left-shifts of unsigned char Linus Torvalds
2009-06-18  8:12             ` Johannes Schindelin
2009-06-18  8:21               ` Junio C Hamano
2009-06-18 16:08               ` Linus Torvalds
2009-06-18 16:45                 ` Johannes Schindelin
2009-06-18 17:15                   ` Linus Torvalds
2009-06-18 17:28                     ` Fix various sparse warnings in the git source code Linus Torvalds
2009-06-18 17:45                       ` Matthieu Moy
2009-06-18 17:52                         ` Linus Torvalds
2009-06-18 21:48                       ` Linus Torvalds [this message]
2009-06-17 22:51         ` [PATCH] Cast things properly to handle >2G files Linus Torvalds

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0906181445530.16802@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).