Re: definition of NULL

2009-08-11 Thread Bruno Haible
Eric Blake wrote: > I argue that NetBSD's definition of NULL is thus buggy It appears to be compliant with ISO C99. This standard requires 6.5.3 and Annex A.2.1 Syntax unary-expression: ... sizeof unary-expression sizeof ( type-name ) cast-expression:

Re: definition of NULL

2009-08-11 Thread Eric Blake
Eric Blake byu.net> writes: > > Indeed, "sizeof (void*)0" parses as sizeof of the type 'void *', followed by a > > stray 0 token => parse error. > > I argue that NetBSD's definition of NULL is thus buggy, and that we should add > a gnulib check and config.h workaround for it. POSIX requires:

Re: definition of NULL

2009-08-11 Thread Eric Blake
Bruno Haible clisp.org> writes: > > +verify (sizeof NULL == sizeof (void *)); > > Citing : > > on NetBSD 5.0 amd64, test-locale.c fails to build > because the call to verify says "sizeof NULL". On NetBSD, NULL is "(void > *)0", and gcc fails to

Re: [PATCH] Exclude optimization

2009-08-11 Thread Sergey Poznyakoff
Sergey Poznyakoff ha escrit: > It may, in same cases, incorrectly recognize the former to be the I wanted to say "in some cases", of course. Regards, Sergey

Re: [PATCH] Exclude optimization

2009-08-11 Thread Sergey Poznyakoff
Hi Ralf, > This would seem to still mis-characterizes patterns such as 'foo]'. Yes, of course. But this function is by no means thought to correctly catch all possible variations of wildcard patterns (one would have to duplicate fnmatch for that). Its purpose is to give a rough estimate on whethe

Re: definition of NULL

2009-08-11 Thread Bruno Haible
Hi Eric, You wrote on 2009-06-26: > +/* Check that NULL can be passed through varargs as a pointer type, > + per POSIX 2008. */ > +verify (sizeof NULL == sizeof (void *)); Citing : on NetBSD 5.0 amd64, test-locale.c fails to build because the call

Re: [PATCH] Exclude optimization

2009-08-11 Thread Ralf Wildenhues
Hello Sergey, * Sergey Poznyakoff wrote on Tue, Aug 11, 2009 at 03:07:03PM CEST: > --- a/lib/exclude.c > +++ b/lib/exclude.c > + > +/* Return true if str has wildcard characters */ > +bool > +fnmatch_pattern_has_wildcards (const char *str, int options) > +{ > + char *cset = "\\?*[]"; > + if (op

Re: HOST_NAME_MAX

2009-08-11 Thread Simon Josefsson
Bruno Haible writes: > Simon Josefsson wrote: >> Then I'm less sure that it makes sense for >> gnulib's limit.h to define HOST_NAME_MAX -- programs written against >> POSIX should not assume that symbol exists. > > On the other hand, the support of POSIX for unspecified maximum host > name length

Re: [PATCH] Exclude optimization

2009-08-11 Thread Sergey Poznyakoff
Hi Bruno, Thanks for your remarks. > Has the precedence handling changed, or is the test checking undefined > behaviour? Yes, it has changed. The first match determines whether the string should be rejected or not. However, it does not rise any compatibility concerns because none of the existing

Re: uname: build problem on win32

2009-08-11 Thread Sam Steingold
Sam Steingold wrote: On Mon, Aug 10, 2009 at 6:26 PM, Bruno Haible wrote: Sam Steingold wrote: the bottom line is: if I add -I build/gnulib/ to module CFLAGS, then include_next will make build/gnulib/unistd.h supersede build/syscalls/gnulib/unistd.h, which is no good. if I do NOT add -I build/g

Re: [PATCH] Exclude optimization

2009-08-11 Thread Bruno Haible
Sergey Poznyakoff wrote: > +test_exclude_LDADD = $(LDADD) You need test_exclude_LDADD = $(LDADD) @LIBINTL@ otherwise on non-glibc systems you get a link error, like this: gcc -g -O2 -L/usr/local/cygwin/lib -o test-exclude.exe test-exclude.o ../gllib/libgnu.a ../gllib/libgnu.a(argmatch.o):

Re: [PATCH] Exclude optimization

2009-08-11 Thread Bruno Haible
Sergey Poznyakoff wrote: > > I would like to see some unit tests committed to this module before the > > big optimization. > > Here they go: This gives a lot of confidence. Thanks. One point, though: When running your new tests against the former 'exclude' implementation, I get one failure: PASS

Re: [PATCH] Exclude optimization

2009-08-11 Thread Sergey Poznyakoff
Hi Bruno, > 'is_fnmatch_pattern' is probably a misnomer, because its argument is [...] > Also, I'm surprised that this function does not take an 'options' argument. > For example, the string 'ab\[cd\]' is constant if FNM_NOESCAPE is off, but > non-constant if FNM_NOESCAPE is on. Fixed both. > I

Re: close_used_without_requesting_gnulib_module_close

2009-08-11 Thread Bruno Haible
With this fix in place, the previous fix from 2009-07-19 [1] is not needed any more. Only tests that open sockets need to depend on 'close'. I'm applying this: [1] http://lists.gnu.org/archive/html/bug-gnulib/2009-07/msg00054.html 2009-08-11 Bruno Haible * modules/dup2-tests (Depends