From 4c4c20c834b4cfbfbe4405c214f9844f075d78d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 17 Mar 2013 19:04:25 +0000 Subject: Fix compilation warning by MinGW GCC. setenv.c [!HAVE_ENVIRON_DECL]: Avoid declaring environ if it is a macro, as this causes compiler warnings with MinGW. --- libiberty/ChangeLog | 5 +++++ libiberty/setenv.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'libiberty') diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index b4c61807b5..fa921e46cf 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2013-03-17 Eli Zaretskii + + * setenv.c [!HAVE_ENVIRON_DECL]: Avoid declaring environ if it is + a macro, as this causes compiler warnings with MinGW. + 2013-03-01 Andreas Schwab * obstacks.texi (Obstacks): Trim @node to only contain the diff --git a/libiberty/setenv.c b/libiberty/setenv.c index 96917d5769..921e968860 100644 --- a/libiberty/setenv.c +++ b/libiberty/setenv.c @@ -63,8 +63,11 @@ extern int errno; #define __environ environ #ifndef HAVE_ENVIRON_DECL +/* MinGW defines environ to call a function. */ +#ifndef environ extern char **environ; #endif +#endif #undef setenv #undef unsetenv -- cgit v1.2.1