Re: gcc-4.3, glibc and AC_PROG_CC_STDC

2007-02-11 Thread Paul Eggert
I am CC'ing this message to gcc@gcc.gnu.org to give GCC developers a heads-up on the situation. For GCC developers: please see for the problem with a gcc-4.3 snapshot with --std=gnu99 -O2" and glibc wchar.h. Ralf Wildenhues <[EM

Re: wint_t in printf-args.c under mingw32

2007-02-11 Thread Ben Pfaff
Bruno Haible <[EMAIL PROTECTED]> writes: > Thanks for reporting this. This is already fixed in gnulib for 6 months: I thought I'd done a "cvs update" recently, but obviously not. Thanks for taking the time to reply. -- Ben Pfaff [EMAIL PROTECTED] http://benpfaff.org

Re: wint_t in printf-args.c under mingw32

2007-02-11 Thread Bruno Haible
Ben Pfaff wrote: > While compiling GNU PSPP under mingw32, for portability testing > purposes, I noticed an error from printf-args.c in gnulib: > > ../../intl/printf-args.c: In function `printf_fetchargs': > ../../intl/printf-args.c:83: warning: `wint_t' is promoted to `int' when > passed through

Re: new module mbsspn

2007-02-11 Thread Bruno Haible
This bug fix was necessary: 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbsspn.c (mbsspn): Fix bug. Remove unnecessary strlen call. --- lib/mbsspn.c5 Feb 2007 03:23:34 - 1.1 +++ lib/mbsspn.c11 Feb 2007 22:36:25 - @@ -47,8 +47,8 @@ for (mbui

Re: new module mbspbrk

2007-02-11 Thread Bruno Haible
A cosmetic tweak: 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbspbrk.c (mbspbrk): Remove unneeded cast. --- lib/mbspbrk.c 5 Feb 2007 03:12:26 - 1.1 +++ lib/mbspbrk.c 11 Feb 2007 22:32:41 - @@ -46,7 +46,7 @@ { if (mb_len (mbui_cur (iter

Re: new module mbscspn

2007-02-11 Thread Bruno Haible
A small optimization was possible: 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbscspn.c (mbscspn): Remove unnecessary strlen call and unneeded cast. --- lib/mbscspn.c 5 Feb 2007 02:52:43 - 1.1 +++ lib/mbscspn.c 11 Feb 2007 22:27:51 - @@ -50,8 +5

mbscasestr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
This patch uses the Knuth-Morris-Pratt algorithm to ensure that mbscasestr() is O(n) worst-case. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> Ensure O(n) worst-case complexity of mbscasestr. * lib/mbscasestr.c: Include stdbool.h. (knuth_morris_pratt_unibyte, knuth_morris_

wint_t in printf-args.c under mingw32

2007-02-11 Thread Ben Pfaff
While compiling GNU PSPP under mingw32, for portability testing purposes, I noticed an error from printf-args.c in gnulib: ../../intl/printf-args.c: In function `printf_fetchargs': ../../intl/printf-args.c:83: warning: `wint_t' is promoted to `int' when passed through `...' ../../intl/printf-args

Re: gcc-4.3, glibc and AC_PROG_CC_STDC

2007-02-11 Thread Ralf Wildenhues
Hello Bruno, * Bruno Haible wrote on Sat, Feb 10, 2007 at 11:44:43PM CET: > > glibc's from 2.3.x up to the most recent ones has a bug [...] > I think autoconf should do something about it. > > There are two possibilities: > - Modify AC_PROG_CC_STDC so that it doesn't activate --std=gnu99 in t

mbsstr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
This patch uses the Knuth-Morris-Pratt algorithm to ensure that mbsstr() is O(n) worst-case. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> Ensure O(n) worst-case complexity of mbsstr. * lib/mbsstr.c: Include stdbool.h. (knuth_morris_pratt_unibyte, knuth_morris_pratt_multib

Re: javacomp.m4 usage [Fwd: Re: Java-related Bison tests all fail]

2007-02-11 Thread Joel E. Denny
On Sun, 11 Feb 2007, Paolo Bonzini wrote: > > > With Bruno's recent Gnulib patch (working around the old tr bug), the above > > fixes Java support in Bison for me. Paolo, is this fine with you? > > Sure it is. Thanks. Committed.

Re: javacomp.m4 usage [Fwd: Re: Java-related Bison tests all fail]

2007-02-11 Thread Paolo Bonzini
With Bruno's recent Gnulib patch (working around the old tr bug), the above fixes Java support in Bison for me. Paolo, is this fine with you? Sure it is. Paolo

Re: new module 'mbsrchr'

2007-02-11 Thread Bruno Haible
This module too requires a fix. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbsrchr.c (mbsrchr): Fix bug. * modules/mbsrchr-tests: New file. * tests/test-mbsrchr.sh: New file. * tests/test-mbsrchr.c: New file. *** lib/mbsrchr.c 5 Feb 2007 01:07:28 -

Re: new module 'mbschr'

2007-02-11 Thread Bruno Haible
I'm adding this fix, and a test case. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbschr.c (mbschr): Fix bug. * modules/mbschr-tests: New file. * tests/test-mbschr.sh: New file. * tests/test-mbschr.c: New file. * m4/locale-zh.m4: New file. *** lib

Re: javacomp.m4 usage [Fwd: Re: Java-related Bison tests all fail]

2007-02-11 Thread Joel E. Denny
On Sat, 10 Feb 2007, Bruno Haible wrote: > 2007-02-10 Bruno Haible <[EMAIL PROTECTED]> > > Enable the Java related testsuite tests when the only Java compiler > found is a gcj < 4.3. > * configure.ac (gt_JAVACOMP): Don't specify a target_version. > > --- configure.ac2

Re: Java-related Bison tests all fail

2007-02-11 Thread Joel E. Denny
On Sun, 11 Feb 2007, Bruno Haible wrote: > Joel E. Denny wrote: > > I am able to reproduce the problem with coreutils 5.2.1 on both an x86 > > Linux and an x86 Solaris. I've attached the erroneous output. > > > > The trouble is the last tr. The following replacement, which I discovered > > by

copying multibyte string iterators

2007-02-11 Thread Bruno Haible
In rare cases, it is necessary to copy iterators (including the multibyte state), rather than creating a new iterator. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * lib/mbiter.h: Include . (mbiter_multi_copy): New function. (mbi_copy): New macro. * lib/mbuiter.h:

new module 'mbslen'

2007-02-11 Thread Bruno Haible
The function 'mbslen' turns out to be a common utility function, needed if one needs to a memory allocation or similar before iterating through a string. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> New module mbslen. * modules/mbslen: New file. * lib/mbslen.c: New file.

strcasestr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
Like c_strstr, here is a patch for strcasestr that avoids quadratic asymptotic complexity. One could consider introducing new modules 'strstr-linear' and 'strcasestr-linear' which override the system's strstr() or strcasestr() functions if they have a quadratic worst-case time consumption. But sin

c-strcasestr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
Like c_strstr, here is a patch for c_strcasestr that avoids quadratic asymptotic complexity. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> Ensure O(n) worst-case complexity of c_strcasestr. * lib/c-strcasestr.c: Include stdbool.h, string.h. (knuth_morris_pratt): New functi

Re: c-strstr: add testcase

2007-02-11 Thread Bruno Haible
Now here's the fix that brings the worst-case complexity down from O(n*m) to O(n). One could use either the Knuth-Morris-Pratt or the Boyer-Moore algorithm. I'm using the former one, because Boyer-Moore works "backwards", which is harder to generalize to the mbsstr case. 2007-02-11 Bruno Haible

Re: c-strstr: add testcase

2007-02-11 Thread Bruno Haible
The "check that the asymptotic worst-case complexity is not quadratic" fails: it takes eternities. I'm therefore going to add a catch for worst-case linear complexity. This is impossible with the current over- optimized 'goto' spaghetti implementation, so I'm replacing it with a maintainable implem

c-strstr: add testcase

2007-02-11 Thread Bruno Haible
Hi, I'm starting to speed up the substring search functions. First, a test case. 2007-02-11 Bruno Haible <[EMAIL PROTECTED]> * modules/c-strstr-tests: New file. * tests/test-c-strstr.c: New file. == modules/c-strstr-tests ==

Re: Java-related Bison tests all fail

2007-02-11 Thread Bruno Haible
Joel E. Denny wrote: > I am able to reproduce the problem with coreutils 5.2.1 on both an x86 > Linux and an x86 Solaris. I've attached the erroneous output. > > The trouble is the last tr. The following replacement, which I discovered > by trial and error, works. I just inserted zz after FG: