9
0
Fork 0

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>
This commit is contained in:
Alexander Aring 2013-11-07 06:46:00 +01:00 committed by Sascha Hauer
parent c3a0d67f77
commit 29ab38ef1c
1 changed files with 2 additions and 1 deletions

View File

@ -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;