From c8b5b745006a833189381eaab119df06bd1c8f44 Mon Sep 17 00:00:00 2001 From: Daan Leijen Date: Mon, 7 Jun 2021 17:51:27 -0700 Subject: [PATCH] improve warnings --- CMakeLists.txt | 3 +++ src/alloc-override.c | 2 +- src/alloc.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca2ce3e3..403251cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,9 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU") if(CMAKE_C_COMPILER_ID MATCHES "GNU") list(APPEND mi_cflags -Wno-invalid-memory-model) endif() + if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang") + list(APPEND mi_cflags -Wpedantic -Wno-static-in-inline) + endif() endif() if(CMAKE_C_COMPILER_ID MATCHES "Intel") diff --git a/src/alloc-override.c b/src/alloc-override.c index 48fc33bb..084f8ae4 100644 --- a/src/alloc-override.c +++ b/src/alloc-override.c @@ -137,7 +137,7 @@ terms of the MIT license. A copy of the license can be found in the file void _ZdlPvmSt11align_val_t(void* p, size_t n, size_t al) { mi_free_size_aligned(p,n,al); } void _ZdaPvmSt11align_val_t(void* p, size_t n, size_t al) { mi_free_size_aligned(p,n,al); } - typedef struct mi_nothrow_s { } mi_nothrow_t; + typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t; #if (MI_INTPTR_SIZE==8) void* _Znwm(size_t n) MI_FORWARD1(mi_new,n); // new 64-bit void* _Znam(size_t n) MI_FORWARD1(mi_new,n); // new[] 64-bit diff --git a/src/alloc.c b/src/alloc.c index 25cc04ef..8acff783 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -557,6 +557,7 @@ void* _mi_externs[] = { (void*)&_mi_page_malloc, (void*)&mi_malloc, (void*)&mi_malloc_small, + (void*)&mi_zalloc_small, (void*)&mi_heap_malloc, (void*)&mi_heap_zalloc, (void*)&mi_heap_malloc_small