Re: definition of NULL

2009-08-14 Thread Bruno Haible
Hi, I wrote: > In m4/locale_h.m4 it's a waste of configure time to check for the include_next > support of locale.h if it's not going to be replaced. I would keep doing > gl_CHECK_NEXT_HEADERS([locale.h]) > conditionally. > > Likewise for m4/stddef_h.m4 and m4/wchar.m4. The part for m4/wchar.m

Re: definition of NULL

2009-08-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 8/13/2009 7:04 AM: > Oh, good point. I've included in the patch refresh. > > I still need time to test on my NetBSD access point. Now tested, with success, so I've pushed the patch. Also, I've filed a report to the NetBS

Re: definition of NULL

2009-08-13 Thread Ralf Wildenhues
Hi Eric, * Eric Blake wrote on Thu, Aug 13, 2009 at 02:27:07PM CEST: > According to Ralf Wildenhues on 8/12/2009 11:53 PM: > > Just to know whether the trouble was spent well: did you report a bug > > with NetBSD? Their fixing their headers would be nice, even with your > > patch, and one would h

Re: definition of NULL

2009-08-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 8/13/2009 3:41 AM: > Hi Eric, > > Wow! What a large change. Largely repetitive, but it adds up fast! > You handled locale.h, stddef.h, stdio.h, stdlib.h, string.h, unistd.h, > wchar.h, > but time.h also should define NU

Re: definition of NULL

2009-08-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ralf Wildenhues on 8/12/2009 11:53 PM: > Just to know whether the trouble was spent well: did you report a bug > with NetBSD? Their fixing their headers would be nice, even with your > patch, and one would hope it wouldn't be a lot of tro

Re: definition of NULL

2009-08-13 Thread Bruno Haible
Hi Eric, Wow! What a large change. > There are only 7 headers defined by POSIX to > define NULL, and we already provide gnulib overrides for 6 of the 7 (the only > one lacking was stddef.h itself). You handled locale.h, stddef.h, stdio.h, stdlib.h, string.h, unistd.h, wchar.h, but time.h also

Re: definition of NULL

2009-08-12 Thread Ralf Wildenhues
Hello, * Eric Blake wrote on Wed, Aug 12, 2009 at 11:45:26PM CEST: > Bruno Haible clisp.org> writes: > > The definition of NULL is a particularly thorny area, because so many > > headers > > use it and so many headers define it. I don't think it's worth the trouble - > > It wasn't _that_ much t

Re: definition of NULL

2009-08-12 Thread Eric Blake
Bruno Haible clisp.org> writes: > > I argue that NetBSD's definition of NULL is thus buggy > > Regarding POSIX, with XSH 2.1.2.(1), you are probably right. > > > we should add gnulib check and config.h workaround for it. > > The definition of NULL is a particularly thorny area, because so many

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: 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: definition of NULL

2009-06-27 Thread Bruno Haible
Eric Blake wrote: > Should we make gnulib provide replacement headers for systems that have such > a > poorly defined NULL? Or is NULL even poorly defined in practice on any of > gnulib's current set of reasonable porting targets? I believe that this problem with NULL existed up until 1995. Si