Re: nstrftime.c fails to build due to memset overflow

2023-05-19 Thread Pádraig Brady
On 18/05/2023 22:27, Paul Eggert wrote: Let's revert the "avoid incorrect -Wmaybe-uninitialized warnings" patch. --enable-gcc-warnings is designed for the default gcc -O2, and we shouldn't dumb down our source code for lesser platforms like "gcc -O0", or clang, or whatever. OK I'll revert. I d

[PATCH] modechange: pacify gcc -Wsuggest-attribute=pure

2023-05-19 Thread Pádraig Brady
* lib/modechange.h (mode_adjust): Add _GL_ATTRIBUTE_PURE suggested with GCC 12 with -flto. --- ChangeLog| 6 ++ lib/modechange.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8e980741c5..5e93f9ac31 100644 --- a/ChangeLog +++ b/Change

[PATCH] hash: pacify gcc -Wsuggest-attribute=const

2023-05-19 Thread Pádraig Brady
* lib/hash.c (compute_bucket_size): Change _GL_ATTRIBUTE_PURE to _GL_ATTRIBUTE_CONST as suggested by GCC 13 with -flto. --- ChangeLog | 6 ++ lib/hash.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5e93f9ac31..a57cc4ae59 100644 --- a/Change

Re: [PATCH] hash: pacify gcc -Wsuggest-attribute=const

2023-05-19 Thread Bruno Haible
Hi Pádraig, > diff --git a/lib/hash.c b/lib/hash.c > index 918aa0d1c3..332cca6df9 100644 > --- a/lib/hash.c > +++ b/lib/hash.c > @@ -492,7 +492,7 @@ check_tuning (Hash_table *table) > TUNING, or return 0 if there is no possible way to allocate that > many entries. */ > > -static size_t

Re: [PATCH] hash: pacify gcc -Wsuggest-attribute=const

2023-05-19 Thread Pádraig Brady
On 19/05/2023 12:03, Bruno Haible wrote: Hi Pádraig, diff --git a/lib/hash.c b/lib/hash.c index 918aa0d1c3..332cca6df9 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -492,7 +492,7 @@ check_tuning (Hash_table *table) TUNING, or return 0 if there is no possible way to allocate that many en

Re: [PATCH] hash: pacify gcc -Wsuggest-attribute=const

2023-05-19 Thread Bruno Haible
Pádraig Brady wrote: > In general for any tuning though, since the tuning param struct is declared > const, That the 'tuning' parameter is a 'const Hash_tuning *' is merely an indication that the function is pure. If it was a 'Hash_tuning *' and if there was an assignment to a field tuning->somet

[PATCH] diffseq: don’t assume integers lack padding

2023-05-19 Thread Paul Eggert
* NEWS: Mention this. * lib/diffseq.h (OFFSET_MAX): Don’t define; this is now the user’s responsibility. * lib/fstrcmp.c (OFFSET_MAX): Define to PTRDIFF_MAX. --- ChangeLog | 8 NEWS | 2 ++ lib/diffseq.h | 5 + lib/fstrcmp.c | 1 + 4 files changed, 12 insertions(+), 4 del

Re: [PATCH] diffseq: don’t assume integers lack padding

2023-05-19 Thread Bruno Haible
Hi Paul, Why this? What was wrong with the previous formula #define OFFSET_MAX \ OFFSET)1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1) (OFFSET being a signed type)? I can't parse your subject line "don’t assume integers lack padding". Bruno

Re: [PATCH] diffseq: don’t assume integers lack padding

2023-05-19 Thread Bruno Haible
> Why this? What was wrong with the previous formula > > #define OFFSET_MAX \ > OFFSET)1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1) > > (OFFSET being a signed type)? The same formula is being used in lib/intprops.h:50:: t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))

Re: nstrftime.c fails to build due to memset overflow

2023-05-19 Thread Bruno Haible
Pádraig Brady wrote: > I'm going to keep this one. > ... > I've lost many hours to analyzing false positives from this one ... > and I've never found a real issue identified by this warning. But can you please remove the line # FP wth -O0 in nstrftime.c w/gcc 12, and 13 at least since we now hav

Re: nstrftime.c fails to build due to memset overflow

2023-05-19 Thread Pádraig Brady
On 19/05/2023 17:39, Bruno Haible wrote: Pádraig Brady wrote: I'm going to keep this one. ... I've lost many hours to analyzing false positives from this one ... and I've never found a real issue identified by this warning. But can you please remove the line # FP wth -O0 in nstrftime.c w/gc

careadlinkat: Silence gcc warning for GCC ≥ 12

2023-05-19 Thread Bruno Haible
In GNU libiconv, I see these warnings: ../../srclib/careadlinkat.c:178:5: warning: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." [-Wcpp] ../../srclib/careadlinkat.c:179:5: warning: #warning "See ." [-Wcpp] ../../srclib/ca