{"thread":{"id":"33644","subject":"[PATCH 1/6] compat/unsetenv.c: Fix a sparse warning","startedAt":"2013-04-27T19:15:38Z","lastAt":"2013-04-27T19:15:38Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"215728","messageId":"517C23DA.8020308@ramsay1.demon.co.uk","threadId":"33644","inReplyTo":null,"subject":"[PATCH 1/6] compat/unsetenv.c: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-04-27T19:15:38Z","receivedAt":"2013-04-27T19:15:38Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe gitunsetenv function includes an (redundant) declaration of the\n'environ' symbol, which is a pointer to the table of environment\nvariables. Unfortunately, on MinGW, this provokes sparse to issue\nthe following warning:\n\n    compat/unsetenv.c:5:20: warning: non-ANSI function declaration of \\\n    function '__p__environ'\n\nOn MinGW, the <stdlib.h> header defines the 'environ' symbol as a\npreprocessor macro (via _environ) which obtains the environ table\npointer via a call to the __p__environ() function.\n\nIn order to suppress the warning, we simply remove the redundant\ndeclaration of the 'environ' symbol, since the symbol is already\ndeclared correctly in <stdlib.h> (included via git-compat-util.h).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/unsetenv.c | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/compat/unsetenv.c b/compat/unsetenv.c\nindex eb29f5e..4ea1856 100644\n--- a/compat/unsetenv.c\n+++ b/compat/unsetenv.c\n@@ -2,7 +2,6 @@\n \n void gitunsetenv (const char *name)\n {\n-     extern char **environ;\n      int src, dst;\n      size_t nmln;\n \n-- \n1.8.2\n"}]}