{"thread":{"id":"33978","subject":"[PATCH v3] path: Fix a sparse warning","startedAt":"2013-05-29T23:53:28Z","lastAt":"2013-05-29T23:53:28Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"218912","messageId":"51A694F8.9090302@ramsay1.demon.co.uk","threadId":"33978","inReplyTo":null,"subject":"[PATCH v3] path: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-05-29T23:53:28Z","receivedAt":"2013-05-29T23:53:28Z","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\nAs promised, this fixes the build on cygwin. (tested on cygwin\nand MinGW. I have not tested on Linux, because I would have to\nre-boot twice, and I wanted to send this out tonight).\n\nAgain, sorry for breaking the build.\n\nATB,\nRamsay Jones\n\n git-compat-util.h | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 660b7f0..aa0404e 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -127,6 +127,9 @@\n #else\n #include <poll.h>\n #endif\n+\n+extern int get_st_mode_bits(const char *path, int *mode);\n+\n #if defined(__MINGW32__)\n /* pull in Windows compatibility stuff */\n #include \"compat/mingw.h\"\n@@ -163,7 +166,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-- \n1.8.3\n"}]}