Bug 1033188 - #include <stdlib.h> for getenv() function declaration. r=glandium
authorChris Peterson <cpeterson@mozilla.com>
Tue, 01 Jul 2014 18:49:52 -0700
changeset 192076 91a55429c78b098926c8f23cacce69beede00178
parent 192075 ed0d0844967e4858764259f7f6d5ecabc01d7ad9
child 192077 b9006622fcecb6fc505b3c710a31ea13a19ed207
push id27073
push usercbook@mozilla.com
push dateThu, 03 Jul 2014 11:47:13 +0000
treeherdermozilla-central@0ddb94bb72c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1033188
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1033188 - #include <stdlib.h> for getenv() function declaration. r=glandium
memory/build/moz.build
memory/build/replace_malloc.c
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -41,8 +41,10 @@ LIBRARY_NAME = 'memory'
 # Keep jemalloc separated when mozglue is statically linked
 if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or
                              CONFIG['MOZ_NATIVE_JEMALLOC']):
     FINAL_LIBRARY = 'mozglue'
 
 if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin':
     # The zone allocator for OSX needs some jemalloc internal functions
     LOCAL_INCLUDES += ['/memory/jemalloc/src/include']
+
+FAIL_ON_WARNINGS = True
--- a/memory/build/replace_malloc.c
+++ b/memory/build/replace_malloc.c
@@ -71,20 +71,21 @@ replace_malloc_init_funcs()
 
 #  define MALLOC_FUNCS MALLOC_FUNCS_ALL
 #include "malloc_decls.h"
     }
   }
 }
 #  elif defined(MOZ_WIDGET_ANDROID)
 #    include <dlfcn.h>
+#    include <stdlib.h>
 static void
 replace_malloc_init_funcs()
 {
-  char *replace_malloc_lib = getenv("MOZ_REPLACE_MALLOC_LIB");
+  const char *replace_malloc_lib = getenv("MOZ_REPLACE_MALLOC_LIB");
   if (replace_malloc_lib && *replace_malloc_lib) {
     void *handle = dlopen(replace_malloc_lib, RTLD_LAZY);
     if (handle) {
 #define MALLOC_DECL(name, ...) \
   replace_ ## name = (replace_ ## name ## _impl_t *) dlsym(handle, "replace_" # name);
 
 #  define MALLOC_FUNCS MALLOC_FUNCS_ALL
 #include "malloc_decls.h"