* m4/memchr-obsolete.m4: Remove file.
* modules/memchr-obsolete: Remove file.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Assume module 'memchr-obsolete' is
absent. Don't define HAVE_MEMCHR.
* lib/string.in.h (memchr): Assume HAVE_MEMCHR is 1.
* modules/memchr (Depends-on): Remove memchr-obsolete.
(configure.ac): Assume HAVE_MEMCHR is 1.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't initialize
HAVE_MEMCHR.
* modules/string (Makefile.am): Don't substitute HAVE_MEMCHR.
* doc/posix-functions/memchr.texi: Don't mention module
'memchr-obsolete'.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Assume HAVE_MEMCHR is 1.
* modules/strnlen (Depends-on): Remove memchr-obsolete.
2020-07-07 Bruno Haible <bruno@clisp.org>
+ memchr: Remove support for some very old platforms.
+ * m4/memchr-obsolete.m4: Remove file.
+ * modules/memchr-obsolete: Remove file.
+ * m4/memchr.m4 (gl_FUNC_MEMCHR): Assume module 'memchr-obsolete' is
+ absent. Don't define HAVE_MEMCHR.
+ * lib/string.in.h (memchr): Assume HAVE_MEMCHR is 1.
+ * modules/memchr (Depends-on): Remove memchr-obsolete.
+ (configure.ac): Assume HAVE_MEMCHR is 1.
+ * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't initialize
+ HAVE_MEMCHR.
+ * modules/string (Makefile.am): Don't substitute HAVE_MEMCHR.
+ * doc/posix-functions/memchr.texi: Don't mention module
+ 'memchr-obsolete'.
+ * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Assume HAVE_MEMCHR is 1.
+ * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Assume HAVE_MEMCHR is 1.
+ * modules/strnlen (Depends-on): Remove memchr-obsolete.
+
dup2: Remove support for some very old platforms.
* m4/dup2-obsolete.m4: Remove file.
* modules/dup2-obsolete: Remove file.
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/memchr.html}
-Gnulib module: memchr or memchr-obsolete
+Gnulib module: memchr
-Portability problems fixed by either Gnulib module @code{memchr} or @code{memchr-obsolete}:
+Portability problems fixed by Gnulib:
@itemize
@item
This function dereferences too much memory on some platforms:
Android 5.0.
@end itemize
-Portability problems fixed by Gnulib module @code{memchr-obsolete}:
-@itemize
-@item
-This function is missing on some older platforms.
-@end itemize
-
Portability problems not fixed by Gnulib:
@itemize
@end itemize
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
# else
-# if ! @HAVE_MEMCHR@
-_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
- _GL_ATTRIBUTE_PURE
- _GL_ARG_NONNULL ((1)));
-# endif
/* On some systems, this function is defined as an overloaded function:
extern "C" { const void * std::memchr (const void *, int, size_t); }
extern "C++" { void * std::memchr (void *, int, size_t); } */
+++ /dev/null
-# memchr-obsolete.m4 serial 1
-dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MEMCHR_OBSOLETE],
-[
- dnl The real code is in memchr.m4.
- :
-])
-# memchr.m4 serial 15
+# memchr.m4 serial 16
dnl Copyright (C) 2002-2004, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_CHECK_FUNCS_ONCE([mprotect])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
- dnl These days, we assume memchr is present. But if support for old
- dnl platforms is desired:
- AC_CHECK_FUNCS_ONCE([memchr])
- if test $ac_cv_func_memchr = no; then
- HAVE_MEMCHR=0
- fi
- ])
- if test $HAVE_MEMCHR = 1; then
- # Detect platform-specific bugs in some versions of glibc:
- # memchr should not dereference anything with length 0
- # https://bugzilla.redhat.com/show_bug.cgi?id=499689
- # memchr should not dereference overestimated length after a match
- # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
- # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
- # memchr should cast the second argument to 'unsigned char'.
- # This bug exists in Android 4.3.
- # Assume that memchr works on platforms that lack mprotect.
- AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # https://bugzilla.redhat.com/show_bug.cgi?id=499689
+ # memchr should not dereference overestimated length after a match
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # memchr should cast the second argument to 'unsigned char'.
+ # This bug exists in Android 4.3.
+ # Assume that memchr works on platforms that lack mprotect.
+ AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
#if HAVE_SYS_MMAN_H
# include <fcntl.h>
}
return result;
]])],
- [gl_cv_func_memchr_works=yes],
- [gl_cv_func_memchr_works=no],
- [case "$host_os" in
- # Guess no on Android.
- linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_memchr_works="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
- esac
- ])
- ])
- case "$gl_cv_func_memchr_works" in
- *yes) ;;
- *) REPLACE_MEMCHR=1 ;;
- esac
- fi
+ [gl_cv_func_memchr_works=yes],
+ [gl_cv_func_memchr_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
])
# Prerequisites of lib/memchr.c.
-# strcasestr.m4 serial 25
+# strcasestr.m4 serial 26
dnl Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_func_strcasestr = no; then
HAVE_STRCASESTR=0
else
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+ if test $REPLACE_MEMCHR = 1; then
REPLACE_STRCASESTR=1
else
dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 23
+# serial 24
# Written by Paul Eggert.
HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO])
HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
- HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
-# strstr.m4 serial 21
+# strstr.m4 serial 22
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MEMCHR])
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+ if test $REPLACE_MEMCHR = 1; then
REPLACE_STRSTR=1
else
dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
Depends-on:
extensions
string
-memchr-obsolete
configure.ac:
gl_FUNC_MEMCHR
-if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+if test $REPLACE_MEMCHR = 1; then
AC_LIBOBJ([memchr])
gl_PREREQ_MEMCHR
fi
+++ /dev/null
-Description:
-memchr() function for old platforms.
-
-Status:
-obsolete
-
-Notice:
-This module is obsolete.
-
-Files:
-m4/memchr-obsolete.m4
-
-Depends-on:
-memchr
-
-configure.ac:
-gl_FUNC_MEMCHR_OBSOLETE
-
-Makefile.am:
-
-Include:
-<string.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
-e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
- -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
Depends-on:
string
extensions
-memchr-obsolete [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1]
configure.ac:
gl_FUNC_STRNLEN