From 516c82ec91ee07de55357e910d93a55eb3d01891 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Oct 2022 14:18:36 -0400 Subject: Fix unused return value warning Kind of annoying since this adds an untested branch, but oh well. --- src/allocator.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/allocator.c b/src/allocator.c index af6b8a9..1da1ec5 100644 --- a/src/allocator.c +++ b/src/allocator.c @@ -60,10 +60,8 @@ zix_default_aligned_alloc(ZixAllocator* const allocator, #if defined(_WIN32) return _aligned_malloc(size, alignment); #elif USE_POSIX_MEMALIGN - // POSIX.1-2008 TC2 says that ptr is not modified on failure void* ptr = NULL; - posix_memalign(&ptr, alignment, size); - return ptr; + return posix_memalign(&ptr, alignment, size) ? NULL : ptr; #else return NULL; #endif -- cgit v1.2.1