diff mbox series

[U-Boot] tools/file2include: don't use malloc.h for malloc

Message ID 20181118020339.11983-1-jsg@jsg.id.au
State Accepted
Commit 958d46b53f3e3683a3d227a20c1935cbe88a8d65
Delegated to: Tom Rini
Headers show
Series [U-Boot] tools/file2include: don't use malloc.h for malloc | expand

Commit Message

Jonathan Gray Nov. 18, 2018, 2:03 a.m. UTC
stdlib.h is the header for malloc since at least c89/c90.
Previously this would fail to build on OpenBSD and fallback to the wrong
header:

In file included from u-boot/tools/file2include.c:21:
u-boot/include/malloc.h:875:5: error: function-like macro
      'CONFIG_IS_ENABLED' is not defined

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
 tools/file2include.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Heinrich Schuchardt Nov. 18, 2018, 7:06 a.m. UTC | #1
On 11/18/18 3:03 AM, Jonathan Gray wrote:
> stdlib.h is the header for malloc since at least c89/c90.
> Previously this would fail to build on OpenBSD and fallback to the wrong
> header:
> 
> In file included from u-boot/tools/file2include.c:21:
> u-boot/include/malloc.h:875:5: error: function-like macro
>       'CONFIG_IS_ENABLED' is not defined
> 
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>

Thanks for catchings this.
Copying Alex as maintainer.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>  tools/file2include.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tools/file2include.c b/tools/file2include.c
> index b98af30a72..775440cba9 100644
> --- a/tools/file2include.c
> +++ b/tools/file2include.c
> @@ -18,7 +18,6 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <stdint.h>
> -#include <malloc.h>
>  
>  /* Size of the blocks written to the compressed file */
>  #define BLOCK_SIZE 8
>
Tom Rini Nov. 27, 2018, 6:47 p.m. UTC | #2
On Sun, Nov 18, 2018 at 01:03:39PM +1100, Jonathan Gray wrote:

> stdlib.h is the header for malloc since at least c89/c90.
> Previously this would fail to build on OpenBSD and fallback to the wrong
> header:
> 
> In file included from u-boot/tools/file2include.c:21:
> u-boot/include/malloc.h:875:5: error: function-like macro
>       'CONFIG_IS_ENABLED' is not defined
> 
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/file2include.c b/tools/file2include.c
index b98af30a72..775440cba9 100644
--- a/tools/file2include.c
+++ b/tools/file2include.c
@@ -18,7 +18,6 @@ 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <malloc.h>
 
 /* Size of the blocks written to the compressed file */
 #define BLOCK_SIZE 8