From 8af021382087293e2205eb15642346c6fdd30a59 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 30 Jul 2021 18:29:05 +0200 Subject: Fix clang warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libkeccak.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'libkeccak.h') diff --git a/libkeccak.h b/libkeccak.h index df712d8..42c9178 100644 --- a/libkeccak.h +++ b/libkeccak.h @@ -9,6 +9,14 @@ #include +#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 -- cgit v1.2.3-70-g09d2