From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <alex.aring@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] dlmalloc: fix compiler warning
Date: Thu, 7 Nov 2013 08:10:59 +0100 [thread overview]
Message-ID: <20131107071059.GP24559@pengutronix.de> (raw)
In-Reply-To: <1383803160-3901-1-git-send-email-alex.aring@gmail.com>
On Thu, Nov 07, 2013 at 06:46:00AM +0100, Alexander Aring wrote:
> 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>
Applied, thanks
Sascha
> ---
> common/dlmalloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/dlmalloc.c b/common/dlmalloc.c
> index b4341fe..f006206 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;
> --
> 1.8.4.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-11-07 7:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 5:46 Alexander Aring
2013-11-07 7:10 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131107071059.GP24559@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=alex.aring@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox