Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-05 Thread Jeffrey Walton
On Mon, Feb 5, 2024 at 2:59 PM Bruno Haible wrote: > > Bjarni Ingi Gislason wrote: > > $(lib_libgnu_a_CFLAGS) is put before $(CFLAGS). > > This is as it should be. The user-provided CFLAGS must override the > package-provided lib_libgnu_a_CFLAGS. Rationale: "The user is always right". ++. See

Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-05 Thread Bruno Haible
Bjarni Ingi Gislason wrote: > $(lib_libgnu_a_CFLAGS) is put before $(CFLAGS). This is as it should be. The user-provided CFLAGS must override the package-provided lib_libgnu_a_CFLAGS. Rationale: "The user is always right". > I have not found the place where such lines are constructed. Makefile

Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-05 Thread Bjarni Ingi Gislason
The cause is an error in "Makefile.in" (lines folded): lib/libgnu_a-malloca.o: lib/malloca.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_libgnu_a_CFLAGS) $(CFLAGS) -MT lib/libgnu_a-malloca.o -MD -MP -MF lib/$(DEPDIR)/libgnu_a-malloca.Tpo -c -o

Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-05 Thread Bruno Haible
Paul Eggert wrote: > I recommend avoiding -Wsign-compare when compiling Gnulib .c files, as > the false positive rate is too large. +1. We already document this in the Gnulib manual: https://www.gnu.org/software/gnulib/manual/html_node/manywarnings.html More generally, we turn off such warnings

Re: lib/malloca.c, different signs of integers; with clang and groff

2024-02-03 Thread Paul Eggert
On 2024-02-03 05:35, Bjarni Ingi Gislason wrote: CC lib/libgnu_a-malloca.o ../lib/malloca.c:61:38: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'idx_t' (aka 'long') [-Wsign-compare] This is a false alarm, as both sides of the comparison are non

lib/malloca.c, different signs of integers; with clang and groff

2024-02-03 Thread Bjarni Ingi Gislason
CC lib/libgnu_a-malloca.o ../lib/malloca.c:61:38: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'idx_t' (aka 'long') [-Wsign-compare] if (!ckd_add (&nplus, n, plus) && !xalloc_oversized (nplus, 1)) ^