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. --- ChangeLog | 5 +++++ tests/test-unsetenv.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5a082f2537..972aec03db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2023-04-24 Paul Eggert + unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var + * 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: suppress some unwanted -fanalyzer checking * tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h: * tests/test-getdtablesize.c, tests/test-listen.c: 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