Hash :
c96bccbb
Author :
Date :
2010-06-23T00:42:54
memmem: rearrange memmem and expand memmem-simple modules Move all functional checks to memmem-simple so that one has a fully functional memmem by using just this module. Restrict the memmem module to performance checks only. Document exactly how the memmem and memmem-simple modules relate to each other. * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE, gl_FUNC_MEMMEM): Move the empty needle check from the memmem module to memmem-simple. Also expand the empty needle check to ensure the correct pointer is returned, not just a non NULL pointer. In gl_FUNC_MEMMEM, make the cross compilation check only consider the versions with performance issues. * doc/glibc-functions/memmem.texi: Rearrange the portability documentation to correlate with the rearranged checks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
@node memmem
@subsection @code{memmem}
@findex memmem
Gnulib module: memmem or memmem-simple
Both modules implement the same replacement for the @code{memmem} function
with the memmem module providing a replacement on more platforms where
the existing @code{memmem} function has a quadratic worst-case complexity.
Portability problems fixed by either Gnulib module @code{memmem-simple}
or @code{memmem}:
@itemize
@item
This function is missing on some platforms:
MacOS X 10.5, FreeBSD 5.2.1, OpenBSD 4.0, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5, BeOS.
@item
This function has reversed arguments on some older platforms:
Linux libc 5.0.9
@item
This function can trigger false positives for long periodic needles on
some platforms:
glibc 2.12, Cygwin 1.7.7.
@item
This function returns incorrect values in some cases, such as when
given an empty needle:
glibc <= 2.0, Cygwin 1.5.x.
@end itemize
Performance problems fixed by Gnulib module @code{memmem}:
@itemize
@item
This function has quadratic instead of linear worst-case complexity on some
platforms:
glibc 2.8, FreeBSD 6.2, NetBSD 5.0, AIX 5.1, Solaris 11 2010-11, Cygwin 1.5.x.
Note for small needles the replacement may be slower.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize