On 22/06/10 15:09, Eric Blake wrote: > On 06/22/2010 03:18 AM, Pádraig Brady wrote: >> >> Note the docs for "memmem" say it fixes >> >> "This function returns incorrect values in some cases, such as when >> given an empty needle: glibc <= 2.0, Cygwin 1.5.x." >> >> Could that functionality be rolled into memmem-simple so that >> memmem is just the "fast/fat" version? If not could you briefly >> expand on "some cases" above as I don't know from the docs if >> I can use memmem-simple. > > The idea is that memmem-simple gives you the replacement only if the > system memmem is buggy (gives wrong answers or reads beyond bounds[1]) > but without regards to whether it is quadratic, while memmem also gives > you the replacement if the system memmem is slow.
Cool, that's what I expected from the names. So do we just need to move a docs around a little like: diff --git a/doc/glibc-functions/memmem.texi b/doc/glibc-functions/memmem.texi index c7e3d73..7d34817 100644 --- a/doc/glibc-functions/memmem.texi +++ b/doc/glibc-functions/memmem.texi @@ -13,14 +13,14 @@ MacOS X 10.3, FreeBSD 5.2.1, OpenBSD 4.0, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5 @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. +...@end itemize + +Portability problems fixed by Gnulib module @code{memmem}: +...@itemize @item This function has quadratic instead of linear worst-case complexity on some platforms: