This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch] string.h/strings.h
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Fri, 19 Aug 2011 15:52:59 +0200
- Subject: [patch] string.h/strings.h
Hi,
I would like to apply the patch below.
It adds #include <strings.h> to assure these files receive the
prototypes of "string/strings family" functions, POSIX has moved, but
newlib still hasn't moved.
Ralf
2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/string/bcmp.c: Include <strings.h> for "memcmp".
* libc/string/bcopy.c: Include <strings.h> for "memmove".
* libc/string/strcasestr.c: Include <strings.h> for "strncasecmp".
* libc/time/strptime.c: Include <strings.h> for "strncasecmp".
Index: libc/string/bcmp.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/bcmp.c,v
retrieving revision 1.3
diff -u -r1.3 bcmp.c
--- libc/string/bcmp.c 28 Oct 2005 21:21:07 -0000 1.3
+++ libc/string/bcmp.c 19 Aug 2011 13:28:35 -0000
@@ -36,6 +36,7 @@
*/
#include <string.h>
+#include <strings.h>
int
_DEFUN (bcmp, (m1, m2, n),
Index: libc/string/bcopy.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/bcopy.c,v
retrieving revision 1.2
diff -u -r1.2 bcopy.c
--- libc/string/bcopy.c 23 May 2002 18:46:04 -0000 1.2
+++ libc/string/bcopy.c 19 Aug 2011 13:28:35 -0000
@@ -27,6 +27,7 @@
*/
#include <string.h>
+#include <strings.h>
void
_DEFUN (bcopy, (b1, b2, length),
Index: libc/string/strcasestr.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/strcasestr.c,v
retrieving revision 1.3
diff -u -r1.3 strcasestr.c
--- libc/string/strcasestr.c 12 Jan 2008 04:25:55 -0000 1.3
+++ libc/string/strcasestr.c 19 Aug 2011 13:28:35 -0000
@@ -76,6 +76,7 @@
#include <ctype.h>
#include <string.h>
+#include <strings.h>
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
# define RETURN_TYPE char *
Index: libc/time/strptime.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/time/strptime.c,v
retrieving revision 1.7
diff -u -r1.7 strptime.c
--- libc/time/strptime.c 12 May 2011 13:41:22 -0000 1.7
+++ libc/time/strptime.c 19 Aug 2011 13:28:36 -0000
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <time.h>
#include <string.h>
+#include <strings.h>
#include <ctype.h>
#include <stdlib.h>
#include "../locale/timelocal.h"