[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings
From: |
Bruno Haible |
Subject: |
bitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings |
Date: |
Mon, 04 Sep 2023 23:34:04 +0200 |
I've seen these two warnings more than once:
test-bitset.c:277:19: warning: variable 'i' set but not used
[-Wunused-but-set-variable]
test-nonblocking-misc.h:101:10: warning: variable 'spent_time' set but not used
[-Wunused-but-set-variable]
Time to fix them...
2023-09-04 Bruno Haible <bruno@clisp.org>
bitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings.
* tests/test-bitset.c (check_zero): Mark 'i' as possibly unused.
* tests/test-nonblocking-reader.h (full_read): Mark 'spent_time' as
possibly unused.
diff --git a/tests/test-bitset.c b/tests/test-bitset.c
index 8c1d6aee7b..b1250d53fe 100644
--- a/tests/test-bitset.c
+++ b/tests/test-bitset.c
@@ -274,7 +274,7 @@ check_zero (bitset bs)
/* FOR_EACH. */
{
bitset_iterator iter;
- bitset_bindex i;
+ _GL_UNUSED bitset_bindex i;
BITSET_FOR_EACH (iter, bs, i, 0)
ASSERT (0);
BITSET_FOR_EACH_REVERSE (iter, bs, i, 0)
diff --git a/tests/test-nonblocking-reader.h b/tests/test-nonblocking-reader.h
index e6f7a3da45..e9076497d4 100644
--- a/tests/test-nonblocking-reader.h
+++ b/tests/test-nonblocking-reader.h
@@ -74,6 +74,7 @@ full_read (size_t fd, void *buf, size_t count)
END_TIMING
dbgfprintf (stderr, "%s: << read -> %ld%s\n", PROG_ROLE,
(long) ret, dbgstrerror (ret < 0, saved_errno));
+ (void) spent_time;
if (ret < 0)
return -1;
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bitset, nonblocking-* tests: Fix gcc -Wunused-but-set-variable warnings,
Bruno Haible <=