{"thread":{"id":"27384","subject":"[PATCH] setup.c: Fix some \"symbol not declared\" sparse warnings","startedAt":"2011-05-17T17:43:10Z","lastAt":"2011-05-17T17:43:10Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"168075","messageId":"4DD2B3AE.8060208@ramsay1.demon.co.uk","threadId":"27384","inReplyTo":null,"subject":"[PATCH] setup.c: Fix some \"symbol not declared\" sparse warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-05-17T17:43:10Z","receivedAt":"2011-05-17T17:43:10Z","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    setup.c:159:3: 'pathspec_magic'\n    setup.c:176:12: 'prefix_pathspec'\n\nThese symbols only require file scope, so we add the static modifier\nto their declarations.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nI noticed these sparse warnings on the next branch (as of a few days\nago).\n\nATB,\nRamsay Jones\n\n setup.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 58dc16c..013ad11 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -152,7 +152,7 @@ void verify_non_filename(const char *prefix, const char *arg)\n  */\n #define PATHSPEC_FROMTOP    (1<<0)\n \n-struct pathspec_magic {\n+static struct pathspec_magic {\n \tunsigned bit;\n \tchar mnemonic; /* this cannot be ':'! */\n \tconst char *name;\n@@ -173,7 +173,7 @@ struct pathspec_magic {\n  * the prefix part must always match literally, and a single stupid\n  * string cannot express such a case.\n  */\n-const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)\n+static const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)\n {\n \tunsigned magic = 0;\n \tconst char *copyfrom = elt;\n-- \n1.7.5\n"}]}