getndelim2 assertion failure on Solaris 10

2008-05-01 Thread Jim Meyering
FYI, [no time now -- will investigate tomorrow if no one beats me to it] test-getndelim2.c:141: assertion failed /bin/bash: line 5: 1259 Abort (core dumped) EXEEXT='' EXEEXT=' ' EXEEXT='' LOCALE_FR='none' LOCALE_TR_UTF8='none' EXEEXT='' EXEEXT='' EXEEXT='' srcdir='.' EXEEXT=''

tests/test-getaddrinfo.c: compile failures on freebsd 6

2008-05-01 Thread Jim Meyering
Here's a fix for the first: test-getaddrinfo.c: In function 'simple': test-getaddrinfo.c:67: error: 'EAI_NODATA' undeclared (first use in this function) test-getaddrinfo.c:67: error: (Each undeclared identifier is reported only once test-getaddrinfo.c:67: error: for each function

Re: paying for the sin of no unit tests: useless-if-before-free bug

2008-05-01 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> Actually this seems more appropriately run from a checked-out >> gnulib directory, e.g., as part of a "make check" rule. > > I would much prefer if the gnulib/Makefile "check" rule be reserved > to platform independent checks on the g

Re: paying for the sin of no unit tests: useless-if-before-free bug

2008-05-01 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Btw, the useless-if-before-free help says that > > Exit status: > > 0 no match > 1 one or more matches > > but it appears to be the opposite: 0 for one or more matches (like 'grep'). Yep. Good catch. It's fixed now. Thanks.

Re: [PATCH] add tests for vc-list-files

2008-05-01 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> ... possibly get a test failure. Such a failure doesn't >> really matter in general -- most people don't run "make syntax-check" >> or "make distcheck" -- so a test failure here is most definitely no >> cause for alarm > > I routinel

Re: [PATCH] add tests for vc-list-files

2008-05-01 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Hi Jim, > >> * tests/test-vc-list-files-cvs.sh: New file. >> * tests/test-vc-list-files-git.sh: New file. > > The two tests fail for me, on Linux, in a testdir created through > gnulib-tool --create-testdir --with-tests ... > > ./test-vc-list-files-cvs.s

Re: getndelim2 improvements

2008-05-01 Thread Eric Blake
Bruno Haible clisp.org> writes: > 3. At least one byte is read, but not stored (due to nmax), and no error. > Return value was 0 and is now -1. You are right that the program can usefully distinguish between -1 and 0 here (with getdelim, there is no nmax parameter, hence getdelim can nev

Re: paying for the sin of no unit tests: useless-if-before-free bug

2008-05-01 Thread Bruno Haible
Jim Meyering wrote: > Actually this seems more appropriately run from a checked-out > gnulib directory, e.g., as part of a "make check" rule. I would much prefer if the gnulib/Makefile "check" rule be reserved to platform independent checks on the gnulib code. Tests of some programs belong in the

Re: [PATCH] add tests for vc-list-files

2008-05-01 Thread Bruno Haible
Hi Jim, > * tests/test-vc-list-files-cvs.sh: New file. > * tests/test-vc-list-files-git.sh: New file. The two tests fail for me, on Linux, in a testdir created through gnulib-tool --create-testdir --with-tests ... ./test-vc-list-files-cvs.sh: line 57: vc-list-files: command not found --- expec

Re: [PATCH] add tests for vc-list-files

2008-05-01 Thread Bruno Haible
Jim Meyering wrote: > ... possibly get a test failure. Such a failure doesn't > really matter in general -- most people don't run "make syntax-check" > or "make distcheck" -- so a test failure here is most definitely no > cause for alarm I routinely use "gnulib-tool --create-testdir --with-tests"

Re: speed up getndelim2

2008-05-01 Thread Bruno Haible
Eric Blake wrote: > $ time (~/coreutils/src/cut -f 2-3 < data > data2) > > real 0m4.168s > user 0m3.952s > sys 0m0.109s > > $ time (/bin/cut -f 2-3 < data > data1) > > real 0m6.194s > user 0m6.109s > sys 0m0.108s Impressing!! However, I have to follow up with a fix for the reallocation

Re: speed up getndelim2

2008-05-01 Thread Bruno Haible
Eric Blake wrote: > And all I did was make getndelim2 smarter to process data in blocks > instead of bytes I'm adding these comments. Otherwise, it is impossible to understand why there is no buffer overrun at the end (when the terminating '\0' is stored). *** lib/getndelim2.c.orig 2008-05

Re: paying for the sin of no unit tests: useless-if-before-free bug

2008-05-01 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > I noticed that I'd broken my useless-if-before-free script. > It would only notice the useless tests if there were > a cast on the argument to the free-like function. > > I've just pushed this correction and will add unit tests. FYI, I've written a cheap u

Re: getndelim2 improvements

2008-05-01 Thread Bruno Haible
Eric Blake wrote: > It also fixes a bug where when the stream is at EOF, sometimes the > function returned 0 and sometimes -1; the patch makes sure EOF always > results in -1 (similar to the Posix 200x specification of getdelim always > returning -1 at EOF). > > - return bytes_stored; > + return

Re: provide inet_?to? declarations in arpa_inet.h

2008-05-01 Thread Bruno Haible
Simon Josefsson wrote: > >> +-e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ > >> +-e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ > >> < $(srcdir)/arpa_inet.in.h; \ > >>} > [EMAIL PROTECTED] > >>mv [EMAIL PROTECTED] $@ > > > > This cannot be

Re: valgrind

2008-05-01 Thread Bruno Haible
Eric Blake wrote: > But 'man valgrind' states: > --suppressions= [default: $PREFIX/lib/valgrind/default.supp] > Specifies an extra file from which to read > descriptions of errors to suppress. You may spec- > ify up to 10 additional suppression