From baaa8edbfb86d093d548b990193973388c809954 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Mon, 9 Sep 2019 16:10:18 -0400 Subject: [PATCH] Avoid warnings about unused variable fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test.c: In function ‘main’: test.c:49:9: warning: variable ‘fails’ set but not used [-Wunused-but-set-variable] int fails = 0; ^~~~~ --- test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test.c b/test.c index ab7ce9a..10a1d91 100644 --- a/test.c +++ b/test.c @@ -46,7 +46,9 @@ size_t lengths[4] = {8, 16, 4, 8}; int main() { uint8_t in[64], out[16], k[16]; int i; +#ifndef GETVECTORS int fails = 0; +#endif for (i = 0; i < 16; ++i) k[i] = i; @@ -88,7 +90,9 @@ int main() { if (memcmp(out, v + (i * len), len)) { printf("fail for %d bytes\n", i); +#ifndef GETVECTORS fails++; +#endif } #endif } @@ -98,8 +102,9 @@ int main() { #else if (!fails) printf("OK\n"); -#endif + fails = 0; +#endif } return 0;