Re: ansi-c++-opt: exploit new autoconf feature

2010-07-31 Thread Ralf Wildenhues
Hi Bruno, * Bruno Haible wrote on Sat, Jul 31, 2010 at 11:35:03PM CEST: > The ansi-c++-opt can make use of the recently released Autoconf 2.66 / 2.67. isn't this a user-visible change worthy of a NEWS entry? Thanks, Ralf > 2010-07-31 Bruno Haible > > ansi-c++-opt: Provide option --ena

modules list update

2010-07-31 Thread Bruno Haible
Once in a while, one needs to update the script that generates the modules list . 2010-07-31 Bruno Haible Update modules list. * MODULES.html.sh (Sorting functions ): Add array-mergesort. (String handling ): Add memcmp2,

tweak of modules descriptions

2010-07-31 Thread Bruno Haible
Hi, In http://www.gnu.org/software/gnulib/MODULES.html, some modules have an annotation in red, due to an ambiguous wording (unclear whether something is a function, a macro, or a variable). This removes it for some of them. 2010-07-31 Bruno Haible Improve doc in MODULES.html.

ansi-c++-opt: exploit new autoconf feature

2010-07-31 Thread Bruno Haible
The ansi-c++-opt can make use of the recently released Autoconf 2.66 / 2.67. 2010-07-31 Bruno Haible ansi-c++-opt: Provide option --enable-c++/--disable-c++ when possible. * m4/ansi-c++.m4 (gl_CXX_CHOICE): In Autoconf 2.66 or newer, provide option --enable/disable-c++

Re: guarantees of u8_mbtouc/u8_strmbtouc

2010-07-31 Thread Bruno Haible
Paolo Bonzini wrote: > "u8_mbtouc will never access more than N bytes. However, as an > additional guarantee, u8_mbtouc only accesses as many bytes as necessary > to decode the first Unicode character, or to ascertain that S does not > begin with a valid UTF-8 sequence." This is complicated to

Re: gnulib new testdir / current build messages

2010-07-31 Thread Bruno Haible
Hello Rainer, Thanks for the new results. The problematic corners are shrinking: - test-areadlink, test-areadlink-with-size, test-areadlinkat, test-readlink, test-symlinkat should work better with my latest commit. - test-poll is in Paolo's hands. - test-utimens, test-utimensat is for Er

Re: readlink on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
With this commit included, Rainer's logs now show that the failure at test-readlink.h:54 is gone. The next one is a bit later: test-readlink.h:77: assertion failed FAIL: test-readlink and also test-areadlink.h:52: assertion failed FAIL: test-areadlink In the same spirit, I'm committing

Re: guarantees of u8_mbtouc/u8_strmbtouc

2010-07-31 Thread Paolo Bonzini
On 07/31/2010 10:24 PM, Bruno Haible wrote: Hi Paolo, Still, without safety u8_strmbtouc(puc, s) uses the same code as u8_mbtouc(puc, s, SIZE_MAX), which makes pretty much my point. I think it is safe and actually very useful to document u8_mbtouc/u16_mbtouc as looking only one byte (resp. one

Re: [PATCH v2 0/5] Speed up uNN_chr and uNN_strchr with Boyer-Moore algorithm

2010-07-31 Thread Bruno Haible
Paolo Bonzini wrote: > >> The point is that u8_mbtouc will look only one byte past the end of > >> a (valid or invalid) character > > > > This is not guaranteed. If you call u8_mbtouc(&uc, needle, 4) you are > > asserting that needle[0..3] are valid memory addresses. > > In practice that's not wha

Re: guarantees of u8_mbtouc/u8_strmbtouc

2010-07-31 Thread Bruno Haible
Hi Paolo, > Still, without safety u8_strmbtouc(puc, s) uses the same code as > u8_mbtouc(puc, s, SIZE_MAX), which makes pretty much my point. I think > it is safe and actually very useful to document u8_mbtouc/u16_mbtouc as > looking only one byte (resp. one short) beyond the first complete ch

Re: speed up u8_strstr

2010-07-31 Thread Bruno Haible
Paolo Bonzini wrote: > If there is one, use the faster u8_strchr algorithm (you can > just use u8_strchr, even though that does a useless conversion back to > UTF-8). Nice suggestion. Implemented as follows: 2010-07-31 Bruno Haible unistr/u8-strstr, unistr/u16-strstr: Optimize the

Re: speed up u8_strstr

2010-07-31 Thread Bruno Haible
Hi Pádraig, > > the u8_strstr function. > > I wonder could we speed that up for UTF-8 > by just deferring to strstr() ? This is a good idea, because the naïve implementation of u8_strstr is quadratic (O(n²)), whereas for strstr we now have an O(n) algorithm. But at the same time, can you also t

Re: [PATCH v2 0/5] Speed up uNN_chr and uNN_strchr with Boyer-Moore algorithm

2010-07-31 Thread Paolo Bonzini
On 07/31/2010 09:35 PM, Bruno Haible wrote: Hi Paolo, I pushed it now, thanks for the review! After I added some more unit tests for u8_strchr, I see crashes and assertion failures: 1) mem = (UNIT *) (page_boundary - 2 * sizeof (UNIT)); mem[0] = 0x50; mem[1] = 0;

Re: [PATCH v2 0/5] Speed up uNN_chr and uNN_strchr with Boyer-Moore algorithm

2010-07-31 Thread Bruno Haible
Hi Paolo, > I pushed it now, thanks for the review! After I added some more unit tests for u8_strchr, I see crashes and assertion failures: 1) mem = (UNIT *) (page_boundary - 2 * sizeof (UNIT)); mem[0] = 0x50; mem[1] = 0; ASSERT (u8_strchr (mem, 0x123) == NULL);

Re: gnulib new testdir / current build messages

2010-07-31 Thread Bruno Haible
Hi Rainer, Eric, > it looks like I now can create the testdir myself. > I successfully build the missing tools. Anyway, I also created a new testdir for you at http://www.haible.de/bruno/gnu/gnulib-20100731-testdir.tar.gz > The only unclean messages during bild are: &g

RE_NO_SUB thread-safety (was Re: A little more regex.h pedantry)

2010-07-31 Thread Paolo Bonzini
On 07/31/2010 12:52 AM, Eric Blake wrote: > The code in re_compile_pattern says: > > /* And GNU code determines whether or not to get register information >by passing null for the REGS argument to re_match, etc., not by >setting no_sub, unless RE_NO_SUB is set. */ > bufp

Re: gettext in bootstrap-tools

2010-07-31 Thread Bruno Haible
Joel, > It sounds like you are giving me advice on whether to include gettext in > gnulib_modules in bootstrap.conf. Indeed, I misunderstood your question. > I am looking for some guideline on how to determine whether > it's helpful to list any given tool and its version in bison release > a

symlinkat: fix doc

2010-07-31 Thread Bruno Haible
The documentation says that the readlinkat() function is to be found in module 'readlinkat'. But no, it is actually in module 'symlinkat'. (I would actually be in favour of splitting this module. One module per function, for clarity.) 2010-07-31 Bruno Haible symlinkat: Fix documentati

Re: fchownat test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > # ./testme > ret = 0 And on Linux, the POSIX-correct result is: ret = -1 errno = 20 Not a directory Actually the code for working around this bug is already present in lib/fchownat.c, conditionalized by CHOWN_TRAILING_SLASH_BUG. On your system, the logs say: checking wh

Re: gettext in bootstrap-tools

2010-07-31 Thread Joel E. Denny
Hi Bruno, On Sat, 31 Jul 2010, Bruno Haible wrote: > > On the bison mailing lists, it was recently suggested that bison should > > include gettext in bootstrap-tools in cfg.mk. That sounds reasonable to > > me, but I see that coreutils and m4 don't do this. > > The gnulib 'gettext' module is

Re: linkat test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > AIX 7BETA: > # ./testme > ret = 0 > ret = 0 Yup. The expected result, as on Linux, is: ret = -1 errno = 20 Not a directory ret = -1 errno = 2 No such file or directory I'm applying the patch below. Eric, if you don't agree, feel free to modify, tweak, or revert it. > P.S

gnulib new testdir / current build messages

2010-07-31 Thread Rainer Tammer
Hello Bruno, it looks like I now can create the testdir myself. I successfully build the missing tools. Base: gnulib-d614713 Solved: test-strtod The only unclean messages during bild are: ... xlc -DHAVE_CONFIG_H -I. -DGNULIB_STRICT_CHECKING=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib -D_THREAD

Re: iconv test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Rainer Tammer wrote: > >> # ./testme >> res = 0 >> outptr-buf = 2, outbytesleft = -1, buf = { 0xC3, 0x84 } >> > This is a buffer overrun bug: Although an outbytesleft argument of 1 is > given, the iconv() function writes 2 bytes into memory. This kind of

Re: M4 1.4.14 on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > # ./testme > acos requires libm > asin requires libm > atan requires libm > atan2 requires libm > cbrt requires libm > copysign requires libm > cos requires libm > cosh requires libm > erf requires libm > erfc requires libm > exp requires libm > fmod requires libm > hypot req

Re: iconv test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > # ./testme > res = 0 > outptr-buf = 2, outbytesleft = -1, buf = { 0xC3, 0x84 } This is a buffer overrun bug: Although an outbytesleft argument of 1 is given, the iconv() function writes 2 bytes into memory. This kind of bug, if not worked around, can crash any program that u

Re: fchownat test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Hello Rainer, > > Rainer Tammer wrote: > >>> test-chown.h:88: assertion failed >>> FAIL: test-fchownat >>> >> test_chown(func = 0x2d50, print = 1), line 88 in "test-chown.h" >> main(), line 70 in "test-fchownat.c" >> > Can you please try an

Re: linkat test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Hello Rainer, > > >>> test-link.h:117: assertion failed >>> FAIL: test-linkat >>> >> test_link(func = 0x29a0, print = 1), line 117 in "test-link.h" >> main(), line 89 in "test-linkat.c" >> ... >> There is a second trap: >> >> ASSERT (func (BASE

Re: fchownat test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Hello Rainer, Rainer Tammer wrote: > > test-chown.h:88: assertion failed > > FAIL: test-fchownat > test_chown(func = 0x2d50, print = 1), line 88 in "test-chown.h" > main(), line 70 in "test-fchownat.c" Can you please try and show the output of this test program? It's a candidate for an au

Re: linkat test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Hello Rainer, > > test-link.h:117: assertion failed > > FAIL: test-linkat > test_link(func = 0x29a0, print = 1), line 117 in "test-link.h" > main(), line 89 in "test-linkat.c" > ... > There is a second trap: > > ASSERT (func (BASE "a", BASE "c/") == -1); > > I have checked the return of

Re: iconv test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Rainer Tammer wrote: > >> AIX 6.1 Technology Level 4: >> >> # xlc testme.c -liconv >> # ./a.out >> res = 0 >> >> AIX 7.1BETA >> >> # ./a.out >> res = 0 >> > Thanks. This is surprising. I'm not sure I fully understand what happens. Can > you run this sligh

Re: M4 1.4.14 on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Rainer Tammer wrote: > >> AIX 7.1BETA >> >> # ./testlibm >> acos is in libc >> asin is in libc >> atan is in libc >> atan2 is in libc >> cbrt is in libc >> copysign is in libc >> cos is in libc >> cosh is in libc >> erf is in libc >> erfc is in libc >> exp is

Re: dirfd on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Rainer Tammer wrote: > >> maybe this is only a glich in the AIX7BETA ? >> > Maybe. But the commit that I did does not harm; it increases gnulib's > robustness also for other platforms. > > Yes, that's true. I already reported this to the AIX 7BETA suppo

Re: iconv test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > AIX 6.1 Technology Level 4: > > # xlc testme.c -liconv > # ./a.out > res = 0 > > AIX 7.1BETA > > # ./a.out > res = 0 Thanks. This is surprising. I'm not sure I fully understand what happens. Can you run this slightly extended test program as well, please? ===

Re: readlink on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Eric Blake wrote: > Is readlink already being replaced due to other bugs? (I guess I need > to look more closely at your logs.) It is not being replaced: HAVE_READLINK='1' REPLACE_READLINK='0' > If so, then I think the replacement > should work around this. If not, I'm perfectly fine relaxing

copysign

2010-07-31 Thread Bruno Haible
On glibc systems, use of copysign() does not require linking with libm. This patch ensures that COPYSIGN_LIBM gets set to empty rather than to -lm. 2010-07-31 Bruno Haible copysign: Does not require -lm on glibc systems. * modules/copysign (configure.ac): Use gl_MATHFUNC, not

Re: M4 1.4.14 on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > AIX 7.1BETA > > # ./testlibm > acos is in libc > asin is in libc > atan is in libc > atan2 is in libc > cbrt is in libc > copysign is in libc > cos is in libc > cosh is in libc > erf is in libc > erfc is in libc > exp is in libc > fmod is in libc > hypot is in libc > j0 is i

Re: duplocale test on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > # ./a.out > i = 0: errno = 22 > Invalid argument > i = 1: errno = 22 > Invalid argument > i = 2: errno = 22 > Invalid argument Thanks. The duplocale() call apparently rejects the LC_GLOBAL_LOCALE argument. I'm adding this workaround: 2010-07-31 Bruno Haible dup

Re: dirfd on AIX 7.1BETA

2010-07-31 Thread Bruno Haible
Rainer Tammer wrote: > maybe this is only a glich in the AIX7BETA ? Maybe. But the commit that I did does not harm; it increases gnulib's robustness also for other platforms. Bruno

Re: gettext in bootstrap-tools

2010-07-31 Thread Bruno Haible
Hi Joel, > On the bison mailing lists, it was recently suggested that bison should > include gettext in bootstrap-tools in cfg.mk. That sounds reasonable to > me, but I see that coreutils and m4 don't do this. The gnulib 'gettext' module is a substitute for part of what 'gettextize' or 'autopo

Re: M4 1.4.14 on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello, Eric Blake wrote: > On 07/30/2010 05:11 PM, Bruno Haible wrote: > >> Other than that: >> >> About mknod, the logs say: >> configure:40991: checking whether mknod can create fifo without root >> privileges >> configure:41015: xlc -o conftest -g -D_THREAD_SAFE conftest.c >&5 >> c

Re: duplocale test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, the duplocale() is new to AIX 7BETA. The AIX 7BETA does not contain all locales, so it could be possible that this fails. Bruno Haible wrote: > Hello Rainer, > > Regarding this test failure: > > test-duplocale.c:70: assertion failed > FAIL: test-duplocale > > What does the follow

Re: fchownat test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Hi Rainer, > > Regarding this test failure: > > test-chown.h:88: assertion failed > FAIL: test-fchownat > > What's the output if you change test-chown.h at line 87 like this: > > ASSERT (func (BASE "dir/file/", -1, -1) == -1); > { int err = errno; fprintf

Re: linkat test on AIX 7.1BETA

2010-07-31 Thread Rainer Tammer
Hello Bruno, Bruno Haible wrote: > Hello Rainer, > > Regarding this test failure: > > test-link.h:117: assertion failed > FAIL: test-linkat > > What's the output when you change test-link.h like this at line 116: > > ASSERT (func (BASE "a/", BASE "c") == -1); > { int err = errno; fprintf (