summaryrefslogtreecommitdiffstats
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-11-07 06:46:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-11-07 08:10:44 +0100
commit29ab38ef1c4f1c2eb154a0e470ee4501e109e5c7 (patch)
tree5e4422e3fab3d62480afc845ec67bd9554d14210 /common/dlmalloc.c
parentc3a0d67f77eec29ad2a3eb24a328becfd693ab8f (diff)
downloadbarebox-29ab38ef1c4f1c2eb154a0e470ee4501e109e5c7.tar.gz
barebox-29ab38ef1c4f1c2eb154a0e470ee4501e109e5c7.tar.xz
dlmalloc: fix compiler warning
This patch fix a compiler warning while building sandbox barebox with gcc version 4.8.2. common/dlmalloc.c: In function ‘barebox_calloc’: common/dlmalloc.c:1756:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] void *mem = malloc(sz); ^ Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index b4341fef54..f0062062fe 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1745,6 +1745,7 @@ void *calloc(size_t n, size_t elem_size)
mchunkptr p;
INTERNAL_SIZE_T csz;
INTERNAL_SIZE_T sz = n * elem_size;
+ void *mem;
/* check if expand_top called, in which case don't need to clear */
mchunkptr oldtop = top;
@@ -1753,7 +1754,7 @@ void *calloc(size_t n, size_t elem_size)
if ((long)n < 0)
return NULL;
- void *mem = malloc(sz);
+ mem = malloc(sz);
if (!mem)
return NULL;