Skip to content

Commit ec535cc

Browse files
Ramsay Jonesgitster
authored andcommitted
compat/unsetenv.c: Fix a sparse warning
The gitunsetenv function includes an (redundant) declaration of the 'environ' symbol, which is a pointer to the table of environment variables. Unfortunately, on MinGW, this provokes sparse to issue the following warning: compat/unsetenv.c:5:20: warning: non-ANSI function declaration of \ function '__p__environ' On MinGW, the <stdlib.h> header defines the 'environ' symbol as a preprocessor macro (via _environ) which obtains the environ table pointer via a call to the __p__environ() function. In order to suppress the warning, we simply remove the redundant declaration of the 'environ' symbol, since the symbol is already declared correctly in <stdlib.h> (included via git-compat-util.h). Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eec7fd8 commit ec535cc

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

compat/unsetenv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
void gitunsetenv (const char *name)
44
{
5-
extern char **environ;
65
int src, dst;
76
size_t nmln;
87

0 commit comments

Comments
 (0)