From c20a63a765dcd22f6b91676ab03507dd9d7b3e2d Mon Sep 17 00:00:00 2001 From: guangli-dai Date: Thu, 10 Apr 2025 15:07:20 -0700 Subject: [PATCH] Silence the uninitialized warning from clang. --- include/jemalloc/internal/jemalloc_internal_inlines_c.h | 2 +- include/jemalloc/internal/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/jemalloc/internal/jemalloc_internal_inlines_c.h b/include/jemalloc/internal/jemalloc_internal_inlines_c.h index c7ef9161..39c196a5 100644 --- a/include/jemalloc/internal/jemalloc_internal_inlines_c.h +++ b/include/jemalloc/internal/jemalloc_internal_inlines_c.h @@ -496,7 +496,7 @@ bool free_fastpath(void *ptr, size_t size, bool size_hint) { assert(tsd_fast(tsd) || *tsd_thread_deallocated_next_event_fastp_get_unsafe(tsd) == 0); - emap_alloc_ctx_t alloc_ctx; + emap_alloc_ctx_t alloc_ctx JEMALLOC_CC_SILENCE_INIT({0, 0, false}); size_t usize; if (!size_hint) { bool err = emap_alloc_ctx_try_lookup_fast(tsd, diff --git a/include/jemalloc/internal/util.h b/include/jemalloc/internal/util.h index 6646386e..35aa26e6 100644 --- a/include/jemalloc/internal/util.h +++ b/include/jemalloc/internal/util.h @@ -29,7 +29,7 @@ * wherever the compiler fails to recognize that the variable is never used * uninitialized. */ -#define JEMALLOC_CC_SILENCE_INIT(v) = v +#define JEMALLOC_CC_SILENCE_INIT(...) = __VA_ARGS__ #ifdef __GNUC__ # define likely(x) __builtin_expect(!!(x), 1)