Address compiler warning when variable is unused because it’s used only in
assert.
../../tests/bench-slope.c: In function 'get_nsec_time':
../../tests/bench-slope.c:155:7: warning: variable 'err' set but not used
[-Wunused-but-set-variable=]
155 | int err;
| ^~~
../../tests/prime.c: In function 'check_primes':
../../tests/prime.c:33:16: warning: variable 'err' set but not used
[-Wunused-but-set-variable=]
33 | gcry_error_t err = GPG_ERR_NO_ERROR;
| ^~~
../../tests/t-fips-service-ind.c: In function 'check_cipher_o_s_e_d_c':
../../tests/t-fips-service-ind.c:927:7: warning: variable 'ptlen' set but not
used [-Wunused-but-set-variable=]
927 | int ptlen;
| ^~~~~
---
tests/bench-slope.c | 1 +
tests/prime.c | 1 +
tests/t-fips-service-ind.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/tests/bench-slope.c b/tests/bench-slope.c
index 4b14541b..bd869efc 100644
--- a/tests/bench-slope.c
+++ b/tests/bench-slope.c
@@ -153,6 +153,7 @@ static void
get_nsec_time (struct nsec_time *t)
{
int err;
+ (void)err;
err = clock_gettime (CLOCK_REALTIME, &t->ts);
assert (err == 0);
diff --git a/tests/prime.c b/tests/prime.c
index a73eb05a..a84de58c 100644
--- a/tests/prime.c
+++ b/tests/prime.c
@@ -31,6 +31,7 @@ static void
check_primes (void)
{
gcry_error_t err = GPG_ERR_NO_ERROR;
+ (void)err;
gcry_mpi_t *factors = NULL;
gcry_mpi_t prime = NULL;
gcry_mpi_t g;
diff --git a/tests/t-fips-service-ind.c b/tests/t-fips-service-ind.c
index bd5dd507..cf6d5298 100644
--- a/tests/t-fips-service-ind.c
+++ b/tests/t-fips-service-ind.c
@@ -933,6 +933,7 @@ check_cipher_o_s_e_d_c (int reject)
size_t taglen = 0;
ptlen = strlen (pt);
+ (void)ptlen;
assert (ptlen == 32);
for (tvidx=0; tvidx < DIM(tv); tvidx++)
{
--
2.51.0
_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel