Re: uninitialized struct members

2009-11-22 Thread Jim Meyering
Bruno Haible wrote: > >> > - struct partition part; >> > + struct partition part IF_LINT (= { .xmid = 0, .ymid = 0 }); >> >> Any code using a one-argument macro like that is rejected, >> due to the comma: >> >> ../lib/diffseq.h:467:64: error: macro "IF_LINT" passed 2 arguments,\ >>

Re: version-etc not working with autoconf 2.61

2009-11-22 Thread Jim Meyering
Andy Wingo wrote: > I just applied this to Guile. Perhaps something like it should go into > Gnulib? ... > diff --git a/lib/version-etc.c b/lib/version-etc.c > index 4f9de48..a7be46e 100644 > --- a/lib/version-etc.c > +++ b/lib/version-etc.c > @@ -245,7 +245,7 @@ emit_bug_reporting_address (void) >

Re: uninitialized struct members

2009-11-22 Thread Bruno Haible
Jim Meyering wrote: > --- a/lib/diffseq.h > +++ b/lib/diffseq.h > @@ -77,6 +77,15 @@ > # endif > #endif > > +/* As above, but when Code must contain one comma. */ > +#ifndef IF_LINT2 > +# ifdef lint > +# define IF_LINT2(Code1, Code2) Code1, Code2 > +# else > +# define IF_LINT2(Code1, Code2) /*

Re: [PATCH] sh-quote: avoid a warning from -Wstrict-prototypes

2009-11-22 Thread Bruno Haible
More details: > The -Wstrict-prototypes warning is 90% a useful warning (think of declarations > of function pointers types) and 10% a stylistic warning - regarding () vs. > (void) > in function *definitions*. The useful part warning is emitted in gcc-4.4.2/gcc/c-decl.c:5035. The stylistic warnin

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Bruno Haible
Eric Blake wrote on 2009-07-18: > fileno(stdout) == 1 by definition of STDOUT_FILENO, so you don't > have to go via fileno (you can directly use fcntl(1,...) to learn whether > the fd has been closed). But the user might have called freopen (..., stdout). In this case, fileno (stdout) will no long

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Bruno Haible
Hi Eric, > > http://www.haible.de/bruno/gnu/libsigsegv-2.8-pre1.tar.gz > > I have confirmed that, with --enable-EFAULT, the latest libsigsegv.git > passes on both cygwin 1.5 and 1.7. Thanks for re-testing! > Without --enable-EFAULT, then a build > of m4 1.4.12 on cygwin 1.5 with the latest

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 11/22/2009 5:32 AM: > Eric Blake wrote on 2009-07-18: >> fileno(stdout) == 1 by definition of STDOUT_FILENO, so you don't >> have to go via fileno (you can directly use fcntl(1,...) to learn whether >> the fd has been close

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Bruno Haible
Eric Blake wrote: > That is ONLY possible if both: > stdin was closed > the user is not using freopen_safer > ... > I'd rather make the patch conditional on whether freopen_safer is also in use. I see. How about this? 2009-11-22 Bruno Haible error: account for the possibility of freop

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 11/22/2009 9:04 AM: >> I'd rather make the patch conditional on whether freopen_safer is also in >> use. > > I see. How about this? A couple of nits, but I'm okay with it. > --- 238,265 > 0); > #

[PATCH] c-stack: avoid defining an unused static function

2009-11-22 Thread Jim Meyering
FYI, find_stack_direction was defined but not used. >From 1398c0de968352891dfaaf26d4f8bf6676e5b060 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 22 Nov 2009 17:11:14 +0100 Subject: [PATCH] c-stack: avoid defining an unused static function * lib/c-stack.c (find_stack_direction): Do not d

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 11/22/2009 9:11 AM: > According to Bruno Haible on 11/22/2009 9:04 AM: >>> I'd rather make the patch conditional on whether freopen_safer is also in >>> use. >> I see. How about this? > > A couple of nits, but I'm okay with

Re: undefined behavior in closeout, aggravated by libsigsegv

2009-11-22 Thread Bruno Haible
Eric Blake wrote: > > #if !_LIBC && defined F_GETFL > > ! int stdout_fd; > > ! > > ! # if GNULIB_FREOPEN_SAFER > > ! /* Use of gnulib's freopen-safer module normally ensures that > > !fileno (stdout) == 1 always. */ > > Are the two spaces intentional? Yes. I'm missing a TeX ma

add some comments

2009-11-22 Thread Bruno Haible
I'm adding comments about a non-trivial idiom in the *.m4 files: 2009-11-22 Bruno Haible Add comments. * m4/dirent_h.m4 (gl_DIRENT_H): Add comment about gl_CHECK_NEXT_HEADERS invocation. * m4/iconv_h.m4 (gl_ICONV_H): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H

locale: get locale_t defined

2009-11-22 Thread Bruno Haible
Hi, According to POSIX:2008, should define the locale_t type. On where the type is nowhere available, we cannot easily provide it. But on glibc and MacOS X it is "nearly" available: - On glibc, it is only available with -D_GNU_SOURCE. - On MacOS X, it is only available with #include . This p

new module 'duplocale'

2009-11-22 Thread Bruno Haible
glibc unfortunately has a big bug in its duplocale function: This module provides a workaround for it. Tested on glibc and MacOS X systems, which are AFAIK the only systems so far with a duplocale function. 2009-11-22 Bruno Haible

vasnprintf: tiny optim

2009-11-22 Thread Bruno Haible
A tiny optimization: Use nl_langinfo also on MacOS X. 2009-11-22 Bruno Haible vasnprintf: Tiny optimization. * lib/vasnprintf.c (decimal_point_char): Choose the fast path also on MacOS X. --- lib/vasnprintf.c.orig 2009-11-23 02:40:23.0 +0100 +++ lib/vasn