Work around GCC bug 125116

* configure.ac: When configured with --enable-gcc-warnings,
use the -Wno-analyzer-allocation-size option if available.
This works around a false positive bug in
GCC 16.0.1 20260321 (Red Hat 16.0.1-0) x86-64; see
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125116>.
This commit is contained in:
Paul Eggert 2026-05-01 17:59:14 -07:00
parent 92788f3be4
commit 0179e3e062

View file

@ -1790,7 +1790,9 @@ AS_IF([test $gl_gcc_warnings = no],
;;
esac
AS_IF([test $gl_gcc_warnings = yes],
[WERROR_CFLAGS=-Werror],
[WERROR_CFLAGS=-Werror
# Work around GCC bug 125116.
gl_WARN_ADD([-Wno-analyzer-allocation-size])],
[# Use -fanalyzer and related options only if --enable-gcc-warnings,
# as they slow GCC considerably.
nw="$nw -fanalyzer -Wno-analyzer-double-free -Wno-analyzer-malloc-leak"