path: Fix a sparse warning
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Wed, 29 May 2013 23:53:28 +0000 (00:53 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 May 2013 00:03:14 +0000 (17:03 -0700)
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 <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h
index e955bb5e8b3101cc8c753cf541beabf5cd037b39..bdc1f436b49f2585e6e61b241c36a2d0b0cf79b9 100644 (file)
 #else
 #include <poll.h>
 #endif
+
+extern int get_st_mode_bits(const char *path, int *mode);
+
 #if defined(__MINGW32__)
 /* pull in Windows compatibility stuff */
 #include "compat/mingw.h"
 typedef long intptr_t;
 typedef unsigned long uintptr_t;
 #endif
-int get_st_mode_bits(const char *path, int *mode);
 #if defined(__CYGWIN__)
 #undef _XOPEN_SOURCE
 #include <grp.h>