{"thread":{"id":"27021","subject":"[PATCH 8/9] sparse: Fix some \"symbol not declared\" warnings","startedAt":"2011-04-07T18:49:33Z","lastAt":"2011-04-07T18:49:33Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"165369","messageId":"4D9E073D.5090006@ramsay1.demon.co.uk","threadId":"27021","inReplyTo":null,"subject":"[PATCH 8/9] sparse: Fix some \"symbol not declared\" warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-04-07T18:49:33Z","receivedAt":"2011-04-07T18:49:33Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn particular, sparse issues the \"symbol 'a_symbol' was not declared.\nShould it be static?\" warnings for the following symbols:\n\n    attr.c:468:12: 'git_etc_gitattributes'\n    attr.c:476:5:  'git_attr_system'\n    vcs-svn/svndump.c:282:6: 'svndump_read'\n    vcs-svn/svndump.c:417:5: 'svndump_init'\n    vcs-svn/svndump.c:432:6: 'svndump_deinit'\n    vcs-svn/svndump.c:445:6: 'svndump_reset'\n\nThe symbols in attr.c only require file scope, so we add the static\nmodifier to their declaration.\n\nThe symbols in vcs-svn/svndump.c are external symbols, and they\nalready have extern declarations in the \"svndump.h\" header file,\nso we simply include the header in svndump.c.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n attr.c            |    4 ++--\n vcs-svn/svndump.c |    1 +\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/attr.c b/attr.c\nindex 0e28ba8..f6b3f7e 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -465,7 +465,7 @@ static void drop_attr_stack(void)\n \t}\n }\n \n-const char *git_etc_gitattributes(void)\n+static const char *git_etc_gitattributes(void)\n {\n \tstatic const char *system_wide;\n \tif (!system_wide)\n@@ -473,7 +473,7 @@ const char *git_etc_gitattributes(void)\n \treturn system_wide;\n }\n \n-int git_attr_system(void)\n+static int git_attr_system(void)\n {\n \treturn !git_env_bool(\"GIT_ATTR_NOSYSTEM\", 0);\n }\ndiff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c\nindex 572a995..bc79222 100644\n--- a/vcs-svn/svndump.c\n+++ b/vcs-svn/svndump.c\n@@ -13,6 +13,7 @@\n #include \"line_buffer.h\"\n #include \"string_pool.h\"\n #include \"strbuf.h\"\n+#include \"svndump.h\"\n \n /*\n  * Compare start of string to literal of equal length;\n-- \n1.7.4\n"}]}