On 02/09/2025 13:34, Pádraig Brady wrote:
On 02/09/2025 13:21, Pádraig Brady wrote:
On 02/09/2025 13:13, Bruno Haible wrote:
Hi Pádraig,

* lib/vma-iter.c (vma_iterate_bsd): Mark parameters unused
on the stub variant.

We had this several times already: As a maintainer of a package that
uses Gnulib, you should *not* be dictating which warnings are to occur
in *.c of Gnulib.

https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00145.html
https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00202.html
https://lists.gnu.org/archive/html/bug-gnulib/2024-10/msg00008.html
https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00139.html
https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00151.html
https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00015.html
https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00226.html

This use of _GL_UNUSED is silly, because vma_iterate_bsd is _meant_
to have different implementations (depending on platform), and it
is _normal_ in such situations that some implementations don't use the
arguments that other implementations use. I don't want to litter the
code with such annotations.

Why is the mechanism that I put in place to protect Gnulib from
warning-related demands not working?

This was just to get the default coreutils build working.
The mechanism you put in to protect gnulib is working mostly
but not it seems for gnulib-tests when building libtests.a
for use by bench-sha1 etc.

Sorry to be clear, the default coreutils build is OK,
it's only when you specify CFLAGS explicitly it fails.
I.e this fails: make CFLAGS='-g -O3'
while make with same CFLAGS in Makefile is OK.

I wonder if pygnulib/GLEmiter.py modified AM_CFLAGS (and AM_CXXFLAGS)
to insert the -Wno-error if supported, it would be preferable
to overriding the CFLAGS user variable?

Manually modifying the AM_CFLAGS variable in gnulib-tests/Makefile
as per the attached, got things working for me.
(Now I know changing CFLAGS outside of configure may not be supported,
but it's very handy sometimes to quickly check things.)

cheers,
Padraig
--- gnulib-tests/Makefile	2025-09-02 19:23:16.189038524 +0000
+++ gnulib-tests/Makefile.good	2025-09-02 19:22:33.255065878 +0000
@@ -4189,7 +4189,7 @@
 CAN_PRINT_STACK_TRACE = 0
 CC = gcc
 CCDEPMODE = depmode=gcc3
-CFLAGS = -Wno-error $(GL_CFLAG_GNULIB_WARNINGS) -g -O2
+CFLAGS = -g -O2
 CFLAG_VISIBILITY = 
 CLOCK_TIME_LIB = 
 CONFIG_INCLUDE = lib/config.h
@@ -7178,7 +7178,7 @@
 test_xstrtoumax_LDADD = $(LDADD) 
 test_xvasprintf_LDADD = $(LDADD) 
 test_yesno_LDADD = $(LDADD) $(LIBUNISTRING)  $(MBRTOWC_LIB) $(LIBC32CONV)
-AM_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS) $(WERROR_CFLAGS) -Wno-error $(GL_CFLAG_GNULIB_WARNINGS)
 
 # A few tests are inherently warning-evoking.
 # In the typical case where we use -Werror, exempt the few offenders.

Reply via email to