summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Ramsay Jones <ramsay@ramsay1.demon.co.uk>2013-04-27 20:15:38 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-28 12:26:38 -0700
commitec535cc27e6c4f5e0b1d157e04f5511f166ecd9d (patch)
treec0a875aac552495b0012206e05beb8e24bbcc3cd /compat
parentcompat/nedmalloc: Fix compiler warnings on linux (diff)
downloadtgif-ec535cc27e6c4f5e0b1d157e04f5511f166ecd9d.tar.xz
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 <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/unsetenv.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/compat/unsetenv.c b/compat/unsetenv.c
index eb29f5e084..4ea18569c2 100644
--- a/compat/unsetenv.c
+++ b/compat/unsetenv.c
@@ -2,7 +2,6 @@
void gitunsetenv (const char *name)
{
- extern char **environ;
int src, dst;
size_t nmln;