From b98993a1baaa2fc39b301676ecbd8bb29e1d9c96 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 24 Apr 2023 12:06:54 -0700 Subject: unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * tests/test-unsetenv.c (main): Make entry static. Even with this change, it’s unclear whether this test is portable POSIX code, but that’s a different matter. --- tests/test-unsetenv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-unsetenv.c b/tests/test-unsetenv.c index ddc412867f..d8e5b01192 100644 --- a/tests/test-unsetenv.c +++ b/tests/test-unsetenv.c @@ -32,7 +32,8 @@ SIGNATURE_CHECK (unsetenv, int, (char const *)); int main (void) { - char entry[] = "b=2"; + /* Static to pacify gcc -Wanalyzer-putenv-of-auto-var. */ + static char entry[] = "b=2"; /* Test removal when multiple entries present. */ ASSERT (putenv ((char *) "a=1") == 0); -- cgit v1.2.1