From 065edc1d46f216ae3987d45fb0e1c277175475a5 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Mon, 11 Sep 2023 13:45:40 +0100 Subject: [PATCH] [umf] Fix macOS build The AppleClang compiler emits warnings in C functions with zero arguments that are not specified as `f(void)`. --- source/common/unified_malloc_framework/src/memory_tracker.c | 6 ++++-- .../common/unified_malloc_framework/src/utils/utils_posix.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/common/unified_malloc_framework/src/memory_tracker.c b/source/common/unified_malloc_framework/src/memory_tracker.c index 55758adee9..76b0b7b745 100644 --- a/source/common/unified_malloc_framework/src/memory_tracker.c +++ b/source/common/unified_malloc_framework/src/memory_tracker.c @@ -21,10 +21,12 @@ #if !defined(_WIN32) critnib *TRACKER = NULL; -void __attribute__((constructor)) createLibTracker() { +void __attribute__((constructor)) createLibTracker(void) { TRACKER = critnib_new(); } -void __attribute__((destructor)) deleteLibTracker() { critnib_delete(TRACKER); } +void __attribute__((destructor)) deleteLibTracker(void) { + critnib_delete(TRACKER); +} umf_memory_tracker_handle_t umfMemoryTrackerGet(void) { return (umf_memory_tracker_handle_t)TRACKER; diff --git a/source/common/unified_malloc_framework/src/utils/utils_posix.c b/source/common/unified_malloc_framework/src/utils/utils_posix.c index 7cbefff1c8..d03bb366a1 100644 --- a/source/common/unified_malloc_framework/src/utils/utils_posix.c +++ b/source/common/unified_malloc_framework/src/utils/utils_posix.c @@ -13,7 +13,7 @@ #include "utils.h" -struct os_mutex_t *util_mutex_create() { +struct os_mutex_t *util_mutex_create(void) { pthread_mutex_t *mutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); int ret = pthread_mutex_init(mutex, NULL); return ret == 0 ? ((struct os_mutex_t *)mutex) : NULL;