diffseq: Silence gcc warning

2023-05-26 Thread Bruno Haible
In gettext and diffutils, I'm still seeing these warnings: diffseq.h:424:36: warning: 'fxbest' may be used uninitialized [-Wmaybe-uninitialized] diffseq.h:431:36: warning: 'bxbest' may be used uninitialized [-Wmaybe-uninitialized] Like done on 2023-05-18, I'm silencing this through a #pragma GC

copy-file: Silence gcc warnings

2023-05-26 Thread Bruno Haible
In GNU gettext, I see these compilation warnings with gcc 13.1.0: gcc ... -Wall -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits

Re: diffseq: Silence gcc warning

2023-05-26 Thread Bruno Haible
> 2023-05-26 Bruno Haible > > diffseq: Silence gcc warning. > * lib/diffseq.h: Add #pragma GCC diagnostic. Oops, this patch was not sufficient. With gcc 13.1.0 I see this warning: diffseq.h:561:20: warning: 'part.xmid' may be used uninitialized [-Wmaybe-uninitialized] This patch

flexmember: Make it easier to use

2023-05-26 Thread Bruno Haible
The most natural use of the 'flexmember' module is to allocate memory for a struct { ; member [FLEXIBLE_ARRAY_MEMBER]; } I was surprised to see that for this use, one has to pass * sizeof () as third argument to FLEXSIZEOF, not merely . I made the mistake of not doing the multiplication

Re: copy-file: Silence gcc warnings

2023-05-26 Thread Pádraig Brady
On 26/05/2023 18:34, Bruno Haible wrote: In GNU gettext, I see these compilation warnings with gcc 13.1.0: gcc ... -Wall -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-ped

Re: copy-file: Silence gcc warnings

2023-05-26 Thread Bruno Haible
Pádraig Brady wrote: > FWIW grep/coreutils use a die() wrapper to achieve this > for this common idiom. > > [Link to github.com elided] https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=dad7ab0b7 Thanks for the pointer. Can we do better than that, without a 'die' macro? Maybe b

Re: copy-file: Silence gcc warnings

2023-05-26 Thread Paul Eggert
On 2023-05-26 15:41, Bruno Haible wrote: Maybe by defining error and error_at_line as inline functions They're defined by glibc, no? The definitions might collide. Also, I suppose the compiler might not inline them and then we'd get a diagnostic anyway. The basic problem is that the old 'er

Re: diffseq: Silence gcc warning

2023-05-26 Thread Paul Eggert
On 2023-05-26 05:56, Bruno Haible wrote: In gettext and diffutils, I'm still seeing these warnings: diffseq.h:424:36: warning: 'fxbest' may be used uninitialized [-Wmaybe-uninitialized] diffseq.h:431:36: warning: 'bxbest' may be used uninitialized [-Wmaybe-uninitialized] I don't get that war