git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v2] path: Fix a sparse warning
@ 2013-05-27 19:24 Ramsay Jones
  2013-05-28 17:04 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ramsay Jones @ 2013-05-27 19:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list, tboegi


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>
---

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(-)

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;
 #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"
-- 
1.8.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND v2] path: Fix a sparse warning
  2013-05-27 19:24 [PATCH RESEND v2] path: Fix a sparse warning Ramsay Jones
@ 2013-05-28 17:04 ` Junio C Hamano
  2013-05-29 13:46   ` Torsten Bögershausen
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2013-05-28 17:04 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list, tboegi

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

> 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>
> ---
>
> 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.

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?

>
> ATB,
> 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;
>  #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"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND v2] path: Fix a sparse warning
  2013-05-28 17:04 ` Junio C Hamano
@ 2013-05-29 13:46   ` Torsten Bögershausen
  2013-05-29 23:57     ` Ramsay Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Torsten Bögershausen @ 2013-05-29 13:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Ramsay Jones, GIT Mailing-list, tboegi

On 2013-05-28 19.04, Junio C Hamano wrote:
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND v2] path: Fix a sparse warning
  2013-05-29 13:46   ` Torsten Bögershausen
@ 2013-05-29 23:57     ` Ramsay Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Ramsay Jones @ 2013-05-29 23:57 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Junio C Hamano, GIT Mailing-list

Torsten Bögershausen wrote:
> On 2013-05-28 19.04, Junio C Hamano wrote:
>>
>> 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.

Thank you for testing this.

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-29 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27 19:24 [PATCH RESEND v2] path: Fix a sparse warning Ramsay Jones
2013-05-28 17:04 ` Junio C Hamano
2013-05-29 13:46   ` Torsten Bögershausen
2013-05-29 23:57     ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).