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
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
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
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
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
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))
^