On some recent libc, mremap() is not defined anymore if __USE_GNU is not set before including sys/mman.h. This results in the following warning : src/dlmalloc.c: In function 'mmap_resize': src/dlmalloc.c:3157:5: warning: implicit declaration of function 'mremap' [-Wimplicit-function-declaration] src/dlmalloc.c:3157:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] src/dlmalloc.c: In function 'sys_trim': src/dlmalloc.c:3574:62: warning: comparison between pointer and integer [enabled by default] and more importantly in realloc() segfaulting. --- ./src/dlmalloc.c 2014-10-06 19:03:44.295840768 +0200 +++ ./src/dlmalloc.c 2014-10-08 18:39:09.391865831 +0200 @@ -1174,6 +1174,7 @@ #endif /* USE_BUILTIN_FFS */ #if HAVE_MMAP #ifndef LACKS_SYS_MMAN_H +#define __USE_GNU /* for mremap */ #include /* for mmap */ #endif /* LACKS_SYS_MMAN_H */ #ifndef LACKS_FCNTL_H