git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 8/9] sparse: Fix some "symbol not declared" warnings
@ 2011-04-07 18:49 Ramsay Jones
  0 siblings, 0 replies; only message in thread
From: Ramsay Jones @ 2011-04-07 18:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list, bebarino


In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warnings for the following symbols:

    attr.c:468:12: 'git_etc_gitattributes'
    attr.c:476:5:  'git_attr_system'
    vcs-svn/svndump.c:282:6: 'svndump_read'
    vcs-svn/svndump.c:417:5: 'svndump_init'
    vcs-svn/svndump.c:432:6: 'svndump_deinit'
    vcs-svn/svndump.c:445:6: 'svndump_reset'

The symbols in attr.c only require file scope, so we add the static
modifier to their declaration.

The symbols in vcs-svn/svndump.c are external symbols, and they
already have extern declarations in the "svndump.h" header file,
so we simply include the header in svndump.c.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 attr.c            |    4 ++--
 vcs-svn/svndump.c |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/attr.c b/attr.c
index 0e28ba8..f6b3f7e 100644
--- a/attr.c
+++ b/attr.c
@@ -465,7 +465,7 @@ static void drop_attr_stack(void)
 	}
 }
 
-const char *git_etc_gitattributes(void)
+static const char *git_etc_gitattributes(void)
 {
 	static const char *system_wide;
 	if (!system_wide)
@@ -473,7 +473,7 @@ const char *git_etc_gitattributes(void)
 	return system_wide;
 }
 
-int git_attr_system(void)
+static int git_attr_system(void)
 {
 	return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
 }
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 572a995..bc79222 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -13,6 +13,7 @@
 #include "line_buffer.h"
 #include "string_pool.h"
 #include "strbuf.h"
+#include "svndump.h"
 
 /*
  * Compare start of string to literal of equal length;
-- 
1.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-07 18:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-07 18:49 [PATCH 8/9] sparse: Fix some "symbol not declared" warnings Ramsay Jones

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 NNTP newsgroup(s).