aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-23 23:49:13 +0200
committerMattias Andrée <maandree@kth.se>2024-08-23 23:49:13 +0200
commit267221b8c2f7de0ea54d12ea0556d2670070ff8f (patch)
treec5aa4223e4c49f1b6e39407faf19ecaf70b98258 /common.h
parentFixes + add SHA2 support via libsha2 (diff)
downloadlibhashsum-267221b8c2f7de0ea54d12ea0556d2670070ff8f.tar.gz
libhashsum-267221b8c2f7de0ea54d12ea0556d2670070ff8f.tar.bz2
libhashsum-267221b8c2f7de0ea54d12ea0556d2670070ff8f.tar.xz
Silence some clang warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/common.h b/common.h
index ac153b6..117972b 100644
--- a/common.h
+++ b/common.h
@@ -1,9 +1,16 @@
/* See LICENSE file for copyright and license details. */
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
+# pragma clang diagnostic ignored "-Wpadded"
+# pragma clang diagnostic ignored "-Wcomma"
+# pragma clang diagnostic ignored "-Wcovered-switch-default"
+#endif
#include "libhashsum.h"
#include <errno.h>
#include <limits.h>
#include <string.h>
+
#ifdef TEST
# include <stdlib.h>
# include <stdio.h>
@@ -155,7 +162,7 @@ run_tests(const char *name, enum libhashsum_algorithm algorithm, size_t hash_siz
return !ok;
}
-#define TEST_MAIN(NAME, ID)\
+# define TEST_MAIN(NAME, ID)\
char hexsum[LIBHASHSUM_##ID##_HASH_SIZE * 2 + 1];\
return run_tests(NAME, LIBHASHSUM_##ID, LIBHASHSUM_##ID##_HASH_SIZE,\
testcases, sizeof(testcases) / sizeof(*testcases), hexsum)