diff options
author | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:29:05 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:29:05 +0200 |
commit | 8af021382087293e2205eb15642346c6fdd30a59 (patch) | |
tree | 985a3f4217a55d2e6c46192d94a9ce94cee36ab2 /libkeccak.h | |
parent | Do not divide by sizeof(char) (diff) | |
download | libkeccak-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 'libkeccak.h')
-rw-r--r-- | libkeccak.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libkeccak.h b/libkeccak.h index df712d8..42c9178 100644 --- a/libkeccak.h +++ b/libkeccak.h @@ -9,6 +9,14 @@ #include <string.h> +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdocumentation" +# pragma clang diagnostic ignored "-Wunknown-attributes" +#endif + + + /** * Only include some C code if compiling with GCC. * @@ -988,9 +996,11 @@ LIBKECCAK_GCC_ONLY(__attribute__((__nonnull__, __unused__, __warn_unused_result_ static inline struct libkeccak_hmac_state * libkeccak_hmac_duplicate(const struct libkeccak_hmac_state *restrict src) { - struct libkeccak_hmac_state* restrict dest = malloc(sizeof(struct libkeccak_hmac_state)); - if (!dest || libkeccak_hmac_copy(dest, src)) - return libkeccak_hmac_free(dest), NULL; + struct libkeccak_hmac_state *restrict dest = malloc(sizeof(struct libkeccak_hmac_state)); + if (!dest || libkeccak_hmac_copy(dest, src)) { + libkeccak_hmac_free(dest); + return NULL; + } return dest; } @@ -1094,4 +1104,8 @@ int libkeccak_hmac_digest(struct libkeccak_hmac_state *restrict state, const voi #include "libkeccak-legacy.h" +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #endif |