summaryrefslogtreecommitdiff
path: root/tests
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 /tests
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-unsetenv.c3
1 files changed, 2 insertions, 1 deletions
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);