Solaris madvise() first parameter is caddr_t; Linux, BSDs, etc. is void*. The cast is safe as void and unsigned char have same alignment. file upstream bug diff --git a/Source/bmalloc/bmalloc/VMAllocate.h b/Source/bmalloc/bmalloc/VMAllocate.h index 580251e..a3e3be3 100644 --- a/Source/bmalloc/bmalloc/VMAllocate.h +++ b/Source/bmalloc/bmalloc/VMAllocate.h @@ -204,7 +204,7 @@ inline void vmDeallocatePhysicalPages(void* p, size_t vmSize) #elif BOS(FREEBSD) SYSCALL(madvise(p, vmSize, MADV_FREE)); #else - SYSCALL(madvise(p, vmSize, MADV_DONTNEED)); + SYSCALL(madvise(reinterpret_cast(p), vmSize, MADV_DONTNEED)); #if BOS(LINUX) SYSCALL(madvise(p, vmSize, MADV_DONTDUMP)); #endif @@ -217,7 +217,7 @@ inline void vmAllocatePhysicalPages(void* p, size_t vmSize) #if BOS(DARWIN) SYSCALL(madvise(p, vmSize, MADV_FREE_REUSE)); #else - SYSCALL(madvise(p, vmSize, MADV_NORMAL)); + SYSCALL(madvise(reinterpret_cast(p), vmSize, MADV_NORMAL)); #if BOS(LINUX) SYSCALL(madvise(p, vmSize, MADV_DODUMP)); #endif