[PATCH] tests: use "compare exp out", not "compare out exp"

2011-11-29 Thread Jim Meyering
FYI, >From d3cd190bdbd88c83fd1487c43d268a5fb1df76a2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 29 Nov 2011 18:14:02 +0100 Subject: [PATCH] tests: use "compare exp out", not "compare out exp" Likewise, when an empty file is expected, use "compare /dev/null out", not "compare out /dev/

[PATCH 1/2] build: accommodate gnulib's new warnings with --enable-gcc-warnings

2011-11-29 Thread Jim Meyering
FYI, more warning-avoidance and a gnulib update: >From 337e3ad58a7b6be7f146b2c14065b5188e329943 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 29 Nov 2011 18:33:31 +0100 Subject: [PATCH 1/2] build: accommodate gnulib's new warnings with --enable-gcc-warnings * configure.ac (WERROR_CFLAG

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 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 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", >>>

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