This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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 v2 2/2] Port strnstr.c to newlib.


On 25/08/17 08:15, Sichen Zhao wrote:

---
  newlib/libc/include/string.h   |  3 +++
  newlib/libc/string/Makefile.am |  1 +
  newlib/libc/string/strnstr.c   | 13 ++++++-------
  3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index 7833aa1..304d8a5 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -121,6 +121,9 @@ size_t     _EXFUN(strnlen,(const char *, size_t));
  #if __BSD_VISIBLE
  char     *_EXFUN(strsep,(char **, const char *));
  #endif
+#if __BSD_VISIBLE
+char     *_EXFUN(strnstr,(const char *, const char *, size_t));
+#endif

I would rather use the FreeBSD prototype:

#if __BSD_VISIBLE
char    *strnstr(const char *, const char *, size_t) __pure;
#endif

This makes the strnstr.c modifications unnecessary. I think the _EXFUN() stuff is deprecated.

Ok, i see.


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