Skip to contentSkip to conversation

path: Fix a sparse warning

PATCH RESEND Superseded Ramsay Jones 3 participants 4 messages Jun 15, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 path: Fix a sparse warning

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.

---

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.

ATB,
Ramsay Jones

 git-compat-util.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-compat-util.h +2 -1
index e955bb5..0e5e4f8 100644
@@ -163,7 +163,6 @@
 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>
@@ -176,6 +175,8 @@ int get_st_mode_bits(const char *path, int *mode);
 #endif
 #endif
 
+extern int get_st_mode_bits(const char *path, int *mode);
+
 /* used on Mac OS X */
 #ifdef PRECOMPOSE_UNICODE
 #include "compat/precompose_utf8.h"
Signature · 1 line
1.8.3
#1 lore raw
Quoted 16 lines · Ramsay Jones

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.

---

Hi Junio,

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

Quoted 7 lines

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.

Will queue.

Can you tell me what the conclusion on the discussion on your two other patches on 'pu'?

* rj/mingw-cygwin (2013-05-08) 2 commits
- cygwin: Remove the CYGWIN_V15_WIN32API build variable
- mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE

I stopped keeping track of the discussion and my vague recollection was that it is OK for 1.5 but not verified on 1.7 or something?

Quoted 28 lines

ATB,
Ramsay Jones

 git-compat-util.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-compat-util.h +2 -1
index e955bb5..0e5e4f8 100644
@@ -163,7 +163,6 @@
 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>
@@ -176,6 +175,8 @@ int get_st_mode_bits(const char *path, int *mode);
 #endif
 #endif
 
+extern int get_st_mode_bits(const char *path, int *mode);
+
 /* used on Mac OS X */
 #ifdef PRECOMPOSE_UNICODE
 #include "compat/precompose_utf8.h"
#2 lore raw
Quoted 11 lines · Junio C Hamano

Can you tell me what the conclusion on the discussion on your two other patches on 'pu'?

* rj/mingw-cygwin (2013-05-08) 2 commits
- cygwin: Remove the CYGWIN_V15_WIN32API build variable
- mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE

I stopped keeping track of the discussion and my vague recollection was that it is OK for 1.5 but not verified on 1.7 or something?

The tests I did under cygwin 1.7 did not show any regression. /Torsten

#3 lore raw
Quoted 9 lines · Torsten Bögershausen
Quoted 8 lines · Junio C Hamano

Can you tell me what the conclusion on the discussion on your two other patches on 'pu'?

* rj/mingw-cygwin (2013-05-08) 2 commits
- cygwin: Remove the CYGWIN_V15_WIN32API build variable
- mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE

Quoted 5 lines
Quoted 3 lines

I stopped keeping track of the discussion and my vague recollection was that it is OK for 1.5 but not verified on 1.7 or something?

The tests I did under cygwin 1.7 did not show any regression.

Thank you for testing this.

ATB,
Ramsay Jones