build error: redundant redeclaration of ‘environ’

git commit efb7b9de added

#ifndef HAVE__NSGETENVIRON
/* FreeBSD needs this; it doesn't seem to hurt other platforms. */
extern char **environ;
#endif

But on my Debian testing with --enable-gcc-warnings, I get

compat.c:1667:15: error: redundant redeclaration of ‘environ’ [-Werror=redundant-decls]
/usr/include/unistd.h:542:15: note: previous declaration of ‘environ’ was here
cc1: all warnings being treated as errors