summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-04-24 12:06:54 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-04-24 12:07:40 -0700
commitb98993a1baaa2fc39b301676ecbd8bb29e1d9c96 (patch)
tree2e926dcbcaecf999b07f6cf1f5ec9956c35bfe42
parent9e6a37ccc2964c63ebc8491ad0da4d6ac668f2b4 (diff)
downloadgnulib-b98993a1baaa2fc39b301676ecbd8bb29e1d9c96.tar.gz
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.
-rw-r--r--ChangeLog5
-rw-r--r--tests/test-unsetenv.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a082f2537..972aec03db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2023-04-24 Paul Eggert <eggert@cs.ucla.edu>
+ 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);