Skip to contentSkip to conversation

malloc: adjust memcpy() and memset() definitions.

PATCH New Heinrich Schuchardt 3 participants 3 messages Feb 10, 2021 – Feb 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 malloc: adjust memcpy() and memset() definitions.

Compiling the sandbox fails on armv7 due to conflicting definitions of memcpy() and memset() in include/malloc.h and include/linux/string.h.

Use linux/string.h here.

---
 include/malloc.h | 3 +++
 1 file changed, 3 insertions(+)
include/malloc.h +3 -0
index f66c2e8617..e15e528a2e 100644
@@ -361,8 +361,11 @@ extern "C" {
 #if (__STD_C || defined(HAVE_MEMCPY))
 
 #if __STD_C
+/* U-Boot defines memset() and memcpy in /include/linux/string.h
 void* memset(void*, int, size_t);
 void* memcpy(void*, const void*, size_t);
+*/
+#include <linux/string.h>
 #else
 #ifdef WIN32
 /* On Win32 platforms, 'memset()' and 'memcpy()' are already declared in */

--
2.30.0

#1 lore raw

PATCH 1/1 malloc: adjust memcpy() and memset() definitions.

Quoted 10 lines · Heinrich Schuchardt

Compiling the sandbox fails on armv7 due to conflicting definitions of memcpy() and memset() in include/malloc.h and include/linux/string.h.

Use linux/string.h here.

---
 include/malloc.h | 3 +++
 1 file changed, 3 insertions(+)
#2 lore raw

PATCH 1/1 malloc: adjust memcpy() and memset() definitions.

In reply to Heinrich Schuchardt
Quoted 7 lines · Heinrich Schuchardt

Compiling the sandbox fails on armv7 due to conflicting definitions of memcpy() and memset() in include/malloc.h and include/linux/string.h.

Use linux/string.h here.

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: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210225/648a8324/attachment.sig>