Re: gnulib: unknown option after '#pragma GCC diagnostic' ...

2011-11-29 Thread Jim Meyering
Bernhard Voelker wrote: > Since gnulib commit 69f517e5975418e7b2c5033f8f60191919f44b9d, > a coreutils build fails when --enable-gcc-warnings is enabled: > > CC propername.o > cc1: warnings being treated as errors > propername.c:21:10: error: unknown option after '#pragma GCC > diagnostic' kin

Re: gnulib: unknown option after '#pragma GCC diagnostic' ...

2011-11-29 Thread Bernhard Voelker
On 11/29/2011 10:11 AM, Jim Meyering wrote: > Bernhard Voelker wrote: >> Since gnulib commit 69f517e5975418e7b2c5033f8f60191919f44b9d, >> a coreutils build fails when --enable-gcc-warnings is enabled: >> >> CC propername.o >> cc1: warnings being treated as errors >> propername.c:21:10: error:

Re: test-float fails on ppc64 because DBL_MIN_EXP < LDBL_MIN_EXP

2011-11-29 Thread Paolo Bonzini
On 08/31/2011 05:48 PM, Jim Meyering wrote: The test-float test is failing on ppc64 with: gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) (albeit an aging Fedora 12 system) due to the failure of this assertion: ASSERT (LDBL_MIN_EXP<= DBL_MIN_EXP); It fails because of these

[PATCH] hash: mark compute_bucket_size with the pure attribute

2011-11-29 Thread Jim Meyering
One more: >From 908690cb743e69c73b42ae310807b29800c8764b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 29 Nov 2011 14:25:56 +0100 Subject: [PATCH] hash: mark compute_bucket_size with the pure attribute * lib/hash.c (compute_bucket_size): Use _GL_ATTRIBUTE_PURE. --- ChangeLog |3 ++

#define FOO rpl_FOO in config.h

2011-11-29 Thread John W. Eaton
While trying to cross compile Octave for MinGW, I hit the following errors: In file included from /home/jwe/src/octave/liboctave/oct-time.h:26:0, from /home/jwe/src/octave/liboctave/file-stat.h:28, from /home/jwe/src/octave/liboctave/file-ops.cc:43: /usr/i

Re: #define FOO rpl_FOO in config.h

2011-11-29 Thread Eric Blake
On 11/29/2011 01:01 AM, John W. Eaton wrote: > While trying to cross compile Octave for MinGW, I hit the following > errors: > > In file included from /home/jwe/src/octave/liboctave/oct-time.h:26:0, >from /home/jwe/src/octave/liboctave/file-stat.h:28, >fro

Re: declare sethostname if unistd.h doesn't

2011-11-29 Thread Ben Walton
Excerpts from Simon Josefsson's message of Mon Nov 21 05:00:04 -0500 2011: > My point was that the POSIX prototype uses size_t and Solaris seems > to use int, and as Paul pointed out, on 64-bit Solaris systems just > providing the prototype will break -- there needs to be a wrapper > function or a

Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 09:35, Jim Meyering wrote: > + gl_WARN_ADD([-Wno-unsuffixed-float-constants]) How about if we remove -Wunsuffixed-float-constants from manywarnings.m4? In practice it typically causes more trouble than it cures (the above-quoted gzip patch is one example, but I've run into it elsewhe

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Jim Meyering
Paul Eggert wrote: > On 11/29/11 09:35, Jim Meyering wrote: >> + gl_WARN_ADD([-Wno-unsuffixed-float-constants]) > > How about if we remove -Wunsuffixed-float-constants from > manywarnings.m4? In practice it typically causes more > trouble than it cures (the above-quoted gzip patch is > one exampl

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 02:05 PM, Paul Eggert wrote: > On 11/29/11 09:35, Jim Meyering wrote: >> + gl_WARN_ADD([-Wno-unsuffixed-float-constants]) > > How about if we remove -Wunsuffixed-float-constants from > manywarnings.m4? In practice it typically causes more > trouble than it cures (the above-quoted g

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 13:18, Jim Meyering wrote: > Have you found code that triggers a -Wformat-zero-length warning > yet that doesn't seem worth adjusting? I haven't run into it one way or another, but all my instincts are against that diagnostic. I suspect that the most-common way that it would happen wo

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 02:27 PM, Paul Eggert wrote: > On 11/29/11 13:18, Jim Meyering wrote: >> Have you found code that triggers a -Wformat-zero-length warning >> yet that doesn't seem worth adjusting? > > I haven't run into it one way or another, but all my instincts are > against that diagnostic. I sus

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Jim Meyering
Eric Blake wrote: > On 11/29/2011 02:05 PM, Paul Eggert wrote: >> On 11/29/11 09:35, Jim Meyering wrote: >>> + gl_WARN_ADD([-Wno-unsuffixed-float-constants]) >> >> How about if we remove -Wunsuffixed-float-constants from >> manywarnings.m4? In practice it typically causes more >> trouble than it

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 13:19, Eric Blake wrote: > hard to disable the warning if you don't want it, but leaving it in > leads to smaller executable size for the cases where 1.0F is sufficient > (compared to the extra size required to represent 1.0 which is 1.0D). 1.0D? But the C standard doesn't allow that

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 02:38 PM, Jim Meyering wrote: >> I'm not convinced about removing it from manywarnings.m4 - it's not that >> hard to disable the warning if you don't want it, but leaving it in >> leads to smaller executable size for the cases where 1.0F is sufficient >> (compared to the extra size re

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 13:38, Jim Meyering wrote: > -#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) > +#define TYPE_IS_INTEGER(t) ((t) 1.5F == 1) I'd rather omit this. The constant is represented exactly and is an immediate operand of a cast. (And I wouldn't be surprised if some compilers warned about the "F"

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Jim Meyering
Paul Eggert wrote: > On 11/29/11 13:38, Jim Meyering wrote: > >> -#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) >> +#define TYPE_IS_INTEGER(t) ((t) 1.5F == 1) > > I'd rather omit this. The constant is represented exactly and is an > immediate operand of a cast. (And I wouldn't be surprised if some >

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 02:46 PM, Eric Blake wrote: >> Unless there are objections (portability?) > > Aargh. I just reread C99. > > F (and f) for float, and L (or l) for long double are required, but D > (or d) for double is a GNU extension. > > Since we can't silence the warning without adding an explic

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 13:32, Eric Blake wrote: >>#if FEATURE_ENABLED >> > #define FEATURE_FORMAT "feature" >> >#else >> > #define FEATURE_FORMAT "" >> >#endif >> >... >> >printf (buf, FEATURE_FORMAT); > I assume you meant sprintf (buf, FEATURE_FORMAT), or printf > (FEATURE_FORMAT)

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Jim Meyering
Eric Blake wrote: > On 11/29/2011 02:38 PM, Jim Meyering wrote: ... > Meanwhile, your patch for adding 'F' is okay, but not for adding 'D'. > That is, > >> +++ b/lib/hash.c >> @@ -113,8 +113,8 @@ struct hash_table >> 1.0). The growth threshold defaults to 0.8, and the growth factor >> defa

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 03:23 PM, Jim Meyering wrote: >>> @@ -238,7 +238,7 @@ hash_print_statistics (const Hash_table *table, FILE >>> *stream) >>>fprintf (stream, "# buckets: %lu\n", (unsigned long int) >>> n_buckets); >>>fprintf (stream, "# buckets used:%lu (%.2f%%)\n", >>>

[PATCH] maint.mk: add syntax check for use of compare from init.sh

2011-11-29 Thread Eric Blake
Comparing expected against actual gives more consistent diff listings when reporting test failures. Enforce this idiom on test files that use init.sh, and allow projects to recognize an alternate pattern for recognizing tests scripts that use a compare function. * top/maint.mk (sc_prohibit_revers

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Bruno Haible
Eric Blake wrote: > Meanwhile, your patch for adding 'F' is okay Why in upper case? The common habit seems to be to use the suffix 'f' in lower case but 'L' in upper case. Don't ask me why, but this is the way it's done in the vast majority of the glibc sources. Bruno -- In memoriam Willy Cohn <

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Eric Blake
On 11/29/2011 04:50 PM, Bruno Haible wrote: > Eric Blake wrote: >> Meanwhile, your patch for adding 'F' is okay > > Why in upper case? The common habit seems to be to use the suffix 'f' > in lower case but 'L' in upper case. Don't ask me why, but this is the > way it's done in the vast majority of

Re: posix_memalign

2011-11-29 Thread Bruno Haible
Eric Blake wrote: > > We have a 'pagealign_alloc' module that does not waste memory. > > Alas, pagealign_alloc is currently GPLv3+, although if libvirt were to > use it in place of posix_memalign, it would have to be LGPLv2+. It > looks like Jim, Paul, and Bruno are the only contributors so far.

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length

2011-11-29 Thread Paul Eggert
On 11/29/11 14:23, Jim Meyering wrote: > if we cared about avoiding the warning, F would be fine there, > since it's printing to a mere %.2f format. We certainly don't need all > of double's precision or exponent range for that. For that app you're right, accuracy doesn't matter. But in general I

Re: undefined behavior in hol_append()

2011-11-29 Thread Bruno Haible
Paul Eggert wrote: > > Do you know of any platforms where sizeof (ptrdiff_t) < sizeof (void *) ? > > The standard operating mode for ILE C/C++ (for IBM i) > has 16-byte pointers; I expect that sizeof (ptrdiff_t) > is 8 and sizeof (void *) is 16 on such platforms, though > I don't have a short cita

Re: test-float fails on ppc64 because DBL_MIN_EXP < LDBL_MIN_EXP

2011-11-29 Thread Bruno Haible
Paolo Bonzini wrote: > > due to the failure of this assertion: > > > > ASSERT (LDBL_MIN_EXP<= DBL_MIN_EXP); > > > > It fails because of these numbers: > > > > $ :|gcc -dD -E -include stddef.h -|grep -E 'L?DBL_MIN_EXP' > > #define __DBL_MIN_EXP__ (-1021) > > #define __LDBL_MIN_EX

Re: declare sethostname if unistd.h doesn't

2011-11-29 Thread Bruno Haible
Hello Ben, > If it would help and people wouldn't mind, I'll post the current patch > series for review so that if I'm off track I can correct before > implementing the remaining bits (including the tests). Cool. Yes, please, show it! > On cygwin, the sethostname function is included in libgnu.a

[PATCH 1/3] Split the HOST_NAME_MAX detection into separate m4 macro

2011-11-29 Thread Ben Walton
The sethostname module will rely on this code too, so make it a separate function. Signed-off-by: Ben Walton --- m4/gethostname.m4 |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/m4/gethostname.m4 b/m4/gethostname.m4 index 8ea6329..784e40a 100644 --- a/m4/gethostnam

[RFC] sethostname handling patch series

2011-11-29 Thread Ben Walton
Hi Bruno, > Cool. Yes, please, show it! Ok, it's following this reply. I'm sure that it's not ready for inclusion just yet, but I'll polish it until it is using the feedback I receive. As always, comments and criticisms welcomed. > It can also be done later by someone else who is more familia

[PATCH 2/3] Add a new sethostname module

2011-11-29 Thread Ben Walton
Define sethostname on platforms that do not provide the declaration. Provide a function for platforms that lack it. The general handling of the provided function is to simply return -1 and set errno to ENOSYS. A handler is provided for Minix. Signed-off-by: Ben Walton --- doc/glibc-functions/s

[PATCH 3/3] Integrate the sethostname module into unistd

2011-11-29 Thread Ben Walton
Ensure that sethostname is accounted for within the unistd module. Signed-off-by: Ben Walton --- lib/unistd.in.h | 24 m4/unistd_h.m4 |7 +-- modules/unistd |3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/unistd.in.h b/lib/unis