bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: please keep 'memmem' module simple


From: Bruno Haible
Subject: Re: please keep 'memmem' module simple
Date: Thu, 10 Jan 2008 00:16:51 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): New macro.
> (gl_FUNC_MEMMEM): Separate performance from presence checks.
> * modules/memmem-simple: New file.
> * modules/memmem (Description): Tweak.
> * MODULES.html.sh (string handling): Mention it.
> * doc/functions/memmem.texi (memmem): Distinguish which flaws are
> addressed by memmem-simple.
> * NEWS: Document the difference.

May I commit these additional tweaks? Clearer documentation, less surprising
configure output, more maintainable module descriptions.


2008-01-09  Bruno Haible  <address@hidden>

        * doc/functions/memmem.texi: Use the same structure as snprintf.texi
        and other files.
        * m4/memmem.m4 (gl_FUNC_MEMMEM): Say "guessing no" instead of "no"
        if it's only a guess.
        * modules/memmem: Simplify by depending on memmem-simple.

*** doc/functions/memmem.texi.orig      2008-01-10 00:12:25.000000000 +0100
--- doc/functions/memmem.texi   2008-01-10 00:12:17.000000000 +0100
***************
*** 4,30 ****
  
  Unspecified by POSIX, but comparable to @code{strstr}.
  
! Gnulib module: memmem, memmem-simple
  
! Portability problems fixed by Gnulib:
  @itemize
  @item
  This function has reversed arguments on some older platforms:
  Linux libc 5.0.9
  
  @item
  This function returns incorrect values in some cases, such as when
! given an empty needle (not fixed in memmem-simple):
  glibc <= 2.0, cygwin 1.5.x
  
  @item
  This function has quadratic instead of linear complexity on some
! platforms (not fixed in memmem-simple):
  glibc <= 2.6.1, cygwin 1.5.x
- 
- @item
- This function is missing on some platforms:
- Mingw, OpenBSD 4.0
  @end itemize
  
  Portability problems not fixed by Gnulib:
--- 4,34 ----
  
  Unspecified by POSIX, but comparable to @code{strstr}.
  
! Gnulib module: memmem or memmem-simple
  
! Portability problems fixed by either Gnulib module @code{memmem-simple}
! or @code{memmem}:
  @itemize
  @item
+ This function is missing on some platforms:
+ Mingw, OpenBSD 4.0
+ 
+ @item
  This function has reversed arguments on some older platforms:
  Linux libc 5.0.9
+ @end itemize
  
+ Portability problems fixed by Gnulib module @code{memmem}:
+ @itemize
  @item
  This function returns incorrect values in some cases, such as when
! given an empty needle:
  glibc <= 2.0, cygwin 1.5.x
  
  @item
  This function has quadratic instead of linear complexity on some
! platforms:
  glibc <= 2.6.1, cygwin 1.5.x
  @end itemize
  
  Portability problems not fixed by Gnulib:
*** m4/memmem.m4.orig   2008-01-10 00:12:25.000000000 +0100
--- m4/memmem.m4        2008-01-09 23:57:26.000000000 +0100
***************
*** 1,4 ****
! # memmem.m4 serial 8
  dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # memmem.m4 serial 9
  dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 51,58 ****
        [gl_cv_func_memmem_works=yes], [gl_cv_func_memmem_works=no],
        [dnl pessimistically assume the worst, since even glibc 2.6.1
         dnl has quadratic complexity in its memmem
!        gl_cv_func_memmem_works=no])])
!     if test $gl_cv_func_memmem_works = no; then
        REPLACE_MEMMEM=1
        AC_LIBOBJ([memmem])
      fi
--- 51,58 ----
        [gl_cv_func_memmem_works=yes], [gl_cv_func_memmem_works=no],
        [dnl pessimistically assume the worst, since even glibc 2.6.1
         dnl has quadratic complexity in its memmem
!        gl_cv_func_memmem_works="guessing no"])])
!     if test "$gl_cv_func_memmem_works" != yes; then
        REPLACE_MEMMEM=1
        AC_LIBOBJ([memmem])
      fi
*** modules/memmem.orig 2008-01-10 00:12:25.000000000 +0100
--- modules/memmem      2008-01-10 00:04:36.000000000 +0100
***************
*** 2,20 ****
  memmem() function: efficiently locate first substring in a buffer.
  
  Files:
- lib/memmem.c
- m4/memmem.m4
  
  Depends-on:
! extensions
! string
! stdint
! memchr
! memcmp
  
  configure.ac:
  gl_FUNC_MEMMEM
- gl_STRING_MODULE_INDICATOR([memmem])
  
  Makefile.am:
  
--- 2,13 ----
  memmem() function: efficiently locate first substring in a buffer.
  
  Files:
  
  Depends-on:
! memmem-simple
  
  configure.ac:
  gl_FUNC_MEMMEM
  
  Makefile.am:
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]