Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2022-01-05 Thread Jim Meyering
On Wed, Jan 5, 2022 at 9:46 AM Bruno Haible wrote: ... > 2022-01-05 Bruno Haible > > gnulib-tool: Avoid known warnings that reflect Gnulib's coding style. > * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): New macro. > * gnulib-tool (func_emit_lib_Makefile_am): Add the >

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2022-01-05 Thread Bruno Haible
Jim Meyering wrote: > I don't have terribly strong feelings here, but I would be inclined to > retain some of those. > > This exposes low-maint-cost ways to improve APIs, both to help the > compiler help us (e.g., via better optimization or better static > analysis) and to help readers know more

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-09 Thread Robbie Harwood
Bruno Haible writes: > Paul Eggert replied: > >> Every other Gnulib-using project I know takes the third approach. > > So, how about adding the third approach to gnulib-tool? > > Rationale: > Gnulib does not want to dictate their preferred GCC flags to coreutils, > grub, etc. > And similarly, we

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-08 Thread Paul Eggert
On 12/8/21 07:48, Bruno Haible wrote: 2) When I collect all warnings in the gllib/ directory of a full testdir, I get (with gcc-9.3): Typically, I don't worry much about warnings by older GCCs, as it's enough of a pain to worry about the latest version. Like Jim I don't have strong

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-08 Thread Jim Meyering
On Wed, Dec 8, 2021 at 7:48 AM Bruno Haible wrote: > > > especially given it's in the gcc -Wextra set, not some random flag > > Warnings in the '-Wall' category are typically worth eliminating: they > regularly point to real bugs. > > Eliminating '-Wsign-compare' warnings, OTOH, is usually a

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-08 Thread Bruno Haible
> especially given it's in the gcc -Wextra set, not some random flag Warnings in the '-Wall' category are typically worth eliminating: they regularly point to real bugs. Eliminating '-Wsign-compare' warnings, OTOH, is usually a waste of time, in my experience: I have hardly ever found a bug

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-07 Thread Paul Eggert
On 12/7/21 11:44, Robbie Harwood wrote: it's odd to me to hear disabling it being the suggested course of action (especially given it's in the gcc -Wextra set, not some random flag). Not odd at all. High-quality static-checking tools have tons of options for a reason, and one shouldn't assume

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-07 Thread Robbie Harwood
Paul Eggert writes: > On 12/1/21 13:02, Robbie Harwood wrote: > >> diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c >> index f679751b9..4aa401e2d 100644 >> --- a/lib/argp-fmtstream.c >> +++ b/lib/argp-fmtstream.c >> @@ -234,7 +234,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) >>

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-01 Thread Paul Eggert
On 12/1/21 13:02, Robbie Harwood wrote: diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c index f679751b9..4aa401e2d 100644 --- a/lib/argp-fmtstream.c +++ b/lib/argp-fmtstream.c @@ -234,7 +234,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) else { size_t