{"thread":{"id":"33707","subject":"[PATCH v2] path: Fix a sparse warning","startedAt":"2013-05-02T19:11:53Z","lastAt":"2013-05-02T19:11:53Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"216307","messageId":"5182BA79.7000801@ramsay1.demon.co.uk","threadId":"33707","inReplyTo":null,"subject":"[PATCH v2] path: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-05-02T19:11:53Z","receivedAt":"2013-05-02T19:11:53Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nOn MinGW, sparse issues an \"'get_st_mode_bits' not declared. Should\nit be static?\" warning. The MinGW and MSVC builds do not see the\ndeclaration of this function, within git-compat-util.h, due to its\nplacement within an preprocessor conditional.\n\nIn order to suppress the warning, we simply move the declaration to\nthe top level of the header.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nThis used to be\n\n    [PATCH 2/6] path: Make the 'get_st_mode_bits' symbol a file static\n\nbut the change in implementation required a change in title.\nThis version simply moves the declaration so that the MinGW and\nMSVC builds can see it.\n\nATB,\nRamsay Jones\n\n git-compat-util.h | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex e955bb5..0e5e4f8 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -163,7 +163,6 @@\n typedef long intptr_t;\n typedef unsigned long uintptr_t;\n #endif\n-int get_st_mode_bits(const char *path, int *mode);\n #if defined(__CYGWIN__)\n #undef _XOPEN_SOURCE\n #include <grp.h>\n@@ -176,6 +175,8 @@ int get_st_mode_bits(const char *path, int *mode);\n #endif\n #endif\n \n+extern int get_st_mode_bits(const char *path, int *mode);\n+\n /* used on Mac OS X */\n #ifdef PRECOMPOSE_UNICODE\n #include \"compat/precompose_utf8.h\"\n-- \n1.8.2\n"}]}