summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-21 20:01:40 -0400
committerDavid Robillard <d@drobilla.net>2023-09-21 20:01:40 -0400
commitbd44c0358b07bc7af07c5fedd160c2553be66d4d (patch)
tree9410d14eedb7ac65fd4f6b214a5d46734c3aa60d
parentfc9c89c66dcdfe296e3b59344cddf4ba52b25be6 (diff)
downloadzix-bd44c0358b07bc7af07c5fedd160c2553be66d4d.tar.gz
zix-bd44c0358b07bc7af07c5fedd160c2553be66d4d.tar.bz2
zix-bd44c0358b07bc7af07c5fedd160c2553be66d4d.zip
Suppress or fix warnings in clang 16
-rw-r--r--benchmark/dict_bench.c19
-rw-r--r--meson.build1
2 files changed, 12 insertions, 8 deletions
diff --git a/benchmark/dict_bench.c b/benchmark/dict_bench.c
index bf8a91a..5d9acd0 100644
--- a/benchmark/dict_bench.c
+++ b/benchmark/dict_bench.c
@@ -1,9 +1,17 @@
-// Copyright 2011-2021 David Robillard <d@drobilla.net>
+// Copyright 2011-2023 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#include "bench.h"
#include "warnings.h"
+typedef struct {
+ char* buf;
+ size_t len;
+} ZixChunk;
+
+#define ZIX_HASH_KEY_TYPE ZixChunk
+#define ZIX_HASH_RECORD_TYPE ZixChunk
+
#include "zix/attributes.h"
#include "zix/digest.h"
#include "zix/hash.h"
@@ -22,11 +30,6 @@ ZIX_RESTORE_WARNINGS
#include <time.h>
typedef struct {
- char* buf;
- size_t len;
-} ZixChunk;
-
-typedef struct {
ZixChunk* chunks;
size_t n_chunks;
char* buf;
@@ -42,8 +45,8 @@ lcg64(const uint64_t i)
return (a * i) + c;
}
-ZIX_PURE_FUNC static const void*
-identity(const void* record)
+ZIX_PURE_FUNC static const ZixChunk*
+identity(const ZixChunk* record)
{
return record;
}
diff --git a/meson.build b/meson.build
index 1dc5f5f..7a0465a 100644
--- a/meson.build
+++ b/meson.build
@@ -48,6 +48,7 @@ if cc.get_id() in ['clang', 'emscripten']
'-Wno-declaration-after-statement',
'-Wno-implicit-fallthrough', # Really for clang < 12
'-Wno-padded',
+ '-Wno-unsafe-buffer-usage',
]
if not meson.is_cross_build()