Avoid warnings about unused variable fails

test.c: In function ‘main’:
test.c:49:9: warning: variable ‘fails’ set but not used [-Wunused-but-set-variable]
     int fails = 0;
         ^~~~~
main
Kyle Altendorf 2019-09-09 16:10:18 -04:00
parent 8e6e4c1e5b
commit baaa8edbfb
1 changed files with 6 additions and 1 deletions

7
test.c
View File

@ -46,7 +46,9 @@ size_t lengths[4] = {8, 16, 4, 8};
int main() { int main() {
uint8_t in[64], out[16], k[16]; uint8_t in[64], out[16], k[16];
int i; int i;
#ifndef GETVECTORS
int fails = 0; int fails = 0;
#endif
for (i = 0; i < 16; ++i) for (i = 0; i < 16; ++i)
k[i] = i; k[i] = i;
@ -88,7 +90,9 @@ int main() {
if (memcmp(out, v + (i * len), len)) { if (memcmp(out, v + (i * len), len)) {
printf("fail for %d bytes\n", i); printf("fail for %d bytes\n", i);
#ifndef GETVECTORS
fails++; fails++;
#endif
} }
#endif #endif
} }
@ -98,8 +102,9 @@ int main() {
#else #else
if (!fails) if (!fails)
printf("OK\n"); printf("OK\n");
#endif
fails = 0; fails = 0;
#endif
} }
return 0; return 0;