This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 06/25] Add struct scratch_buffer and its internal helper functions


On 04/07/2015 04:33 PM, Florian Weimer wrote:
> On 04/07/2015 03:18 PM, Stefan Liebler wrote:
>> Hi Florian,
>>
>> i get a build error on s390x:
>> gcc scratch_buffer_grow_preserve.c -c
>> ...
>> scratch_buffer_grow_preserve.c: In function
>> â__libc_scratch_buffer_grow_preserveâ:
>> scratch_buffer_grow_preserve.c:35:7: error: implicit declaration of
>> function âmemcpyâ [-Werror=implicit-function-declaration]
>>        memcpy (new_ptr, buffer->__space, buffer->length);
>>        ^
>> scratch_buffer_grow_preserve.c:35:7: error: incompatible implicit
>> declaration of built-in function âmemcpyâ [-Werror]
>> cc1: all warnings being treated as errors
>>
>> #include <string.h> in malloc/scratch_buffer_grow_preserve.c solves this
>> error. Please update scratch_buffer_grow_preserve.c.
> 
> Sorry about that.  I did build on ppc64, but building on s390x is
> difficult for me due to the binutils 2.24 requirement.  I'm trying to
> get a suitable machine reservation, but I'm not sure if that will succeed.
> 
> Should I commit this fix blindly, without testing it on s390x?

I found a machine to test this on, so I committed the attached patch.

-- 
Florian Weimer / Red Hat Product Security
>From 72301304a5655662baf2bae88a7aceeabc4a753e Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Tue, 7 Apr 2015 17:46:58 +0200
Subject: [PATCH] scratch_buffer_grow_preserve: Add missing #include <string.h>

---
 ChangeLog                             | 4 ++++
 malloc/scratch_buffer_grow_preserve.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4e1df07..c0d3aca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-04-07  Florian Weimer  <fweimer@redhat.com>
 
+	* malloc/scratch_buffer_grow_preserve.c: Include <string.h>
+
+2015-04-07  Florian Weimer  <fweimer@redhat.com>
+
 	* include/scratch_buffer.h: New file.
 	* malloc/scratch_buffer_grow.c: Likewise.
 	* malloc/scratch_buffer_grow_preserve.c: Likewise.
diff --git a/malloc/scratch_buffer_grow_preserve.c b/malloc/scratch_buffer_grow_preserve.c
index f2edb49..c5f0b2d 100644
--- a/malloc/scratch_buffer_grow_preserve.c
+++ b/malloc/scratch_buffer_grow_preserve.c
@@ -18,6 +18,7 @@
 
 #include <scratch_buffer.h>
 #include <errno.h>
+#include <string.h>
 
 bool
 __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
-- 
2.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]