aboutsummaryrefslogtreecommitdiffstats
path: root/test.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-07-30 18:29:05 +0200
committerMattias Andrée <maandree@kth.se>2021-07-30 18:29:05 +0200
commit8af021382087293e2205eb15642346c6fdd30a59 (patch)
tree985a3f4217a55d2e6c46192d94a9ce94cee36ab2 /test.c
parentDo not divide by sizeof(char) (diff)
downloadlibkeccak-8af021382087293e2205eb15642346c6fdd30a59.tar.gz
libkeccak-8af021382087293e2205eb15642346c6fdd30a59.tar.bz2
libkeccak-8af021382087293e2205eb15642346c6fdd30a59.tar.xz
Fix clang warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test.c')
-rw-r--r--test.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/test.c b/test.c
index 020e045..7cd5ab4 100644
--- a/test.c
+++ b/test.c
@@ -177,8 +177,10 @@ test_digest_case(const struct libkeccak_spec *restrict spec, const char *restric
return -1;
}
- if (libkeccak_digest(&state, msg, strlen(msg) - !!bits, (size_t)bits, suffix, hashsum))
- return perror("libkeccak_digest"), -1;
+ if (libkeccak_digest(&state, msg, strlen(msg) - !!bits, (size_t)bits, suffix, hashsum)) {
+ perror("libkeccak_digest");
+ return -1;
+ }
libkeccak_state_fast_destroy(&state);
libkeccak_behex_lower(hexsum, hashsum, (size_t)((spec->output + 7) / 8));
@@ -649,6 +651,11 @@ test_squeeze(void)
return -1;
}
+# if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wcomma"
+# endif
+
printf("Testing squeeze functions with slow initial digest:\n");
printf(" 1 extra squeeze, including 0 fast squeezes: "), run_test(0, 1, 0);
printf(" 2 extra squeezes, including 0 fast squeezes: "), run_test(0, 2, 0);
@@ -675,6 +682,10 @@ test_squeeze(void)
printf(" 4 extra squeezes, including 3 fast squeezes: "), run_test(3, 4, 1);
printf("\n");
+# if defined(__clang__)
+# pragma clang diagnostic pop
+# endif
+
libkeccak_state_fast_destroy(&state);
free(hashsum);
free(hexsum);