On MinGW, sparse issues an "'get_st_mode_bits' not declared. Should
it be static?" warning. The MinGW and MSVC builds do not see the
declaration of this function, within git-compat-util.h, due to its
placement within an preprocessor conditional.

In order to suppress the warning, we simply move the declaration to
the top level of the header.

Signed-off-by: Ramsay Jones <ram...@ramsay1.demon.co.uk>

Hi Junio,

Now that v1.8.3 is out, I note that this patch seems to have been
dropped (or did I miss something?).

This used to be

    [PATCH 2/6] path: Make the 'get_st_mode_bits' symbol a file static

but the change in implementation required a change in title.
This version simply moves the declaration so that the MinGW and
MSVC builds can see it.

Ramsay Jones

 git-compat-util.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index e955bb5..0e5e4f8 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -163,7 +163,6 @@
 typedef long intptr_t;
 typedef unsigned long uintptr_t;
-int get_st_mode_bits(const char *path, int *mode);
 #if defined(__CYGWIN__)
 #include <grp.h>
@@ -176,6 +175,8 @@ int get_st_mode_bits(const char *path, int *mode);
+extern int get_st_mode_bits(const char *path, int *mode);
 /* used on Mac OS X */
 #include "compat/precompose_utf8.h"

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to