Skip to contentSkip to conversation

tools/file2include: don't use malloc.h for malloc

PATCH In review Jonathan Gray 3 participants 3 messages Nov 18, 2018 – Nov 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/file2include: don't use malloc.h for malloc

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

---
 tools/file2include.c | 1 -
 1 file changed, 1 deletion(-)
tools/file2include.c +0 -1
index b98af30a72..775440cba9 100644
@@ -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
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 tools/file2include: don't use malloc.h for malloc

Quoted 9 lines · Jonathan Gray

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

Thanks for catchings this.
Copying Alex as maintainer.

Quoted 17 lines
---
 tools/file2include.c | 1 -
 1 file changed, 1 deletion(-)
tools/file2include.c +0 -1
index b98af30a72..775440cba9 100644
@@ -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
#2 lore raw
In reply to Jonathan Gray
Quoted 10 lines · Jonathan Gray

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/91fb262c/attachment.sig>