From c0c854e68f3977a7fcd18bdbe798063ec60f13ee Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Fri, 4 Feb 2022 10:39:21 -0500 Subject: [PATCH] Fix pointer casting warnings by adding the appropriate casts --- src/gc-alloc-profiler.h | 2 +- src/gc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gc-alloc-profiler.h b/src/gc-alloc-profiler.h index 3cfe7237dd183..8be6fed21a899 100644 --- a/src/gc-alloc-profiler.h +++ b/src/gc-alloc-profiler.h @@ -35,7 +35,7 @@ void _maybe_record_alloc_to_profile(jl_value_t *val, size_t size, jl_datatype_t extern int g_alloc_profile_enabled; -#define jl_gc_unknown_type_tag ((uintptr_t)0xdeadaa03) +#define jl_gc_unknown_type_tag ((jl_datatype_t*)0xdeadaa03) static inline void maybe_record_alloc_to_profile(jl_value_t *val, size_t size, jl_datatype_t *typ) JL_NOTSAFEPOINT { if (__unlikely(g_alloc_profile_enabled)) { diff --git a/src/gc.c b/src/gc.c index 8fd83a3b42589..745f5365510f9 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3558,7 +3558,7 @@ JL_DLLEXPORT void *jl_gc_managed_malloc(size_t sz) #endif errno = last_errno; // jl_gc_managed_malloc is currently always used for allocating array buffers. - maybe_record_alloc_to_profile(b, sz, jl_buff_tag); + maybe_record_alloc_to_profile(b, sz, (jl_datatype_t*)jl_buff_tag); return b; }