Hi Paul,

Commit 06eefab41ee78359975b201f0e0ba025d28c0226 has two mistakes, AFAICS:

  - The #if condition for the '# pragma GCC diagnostic pop' near the end of
    the file is different from the #if condition for the
    '# pragma GCC diagnostic push' near the beginning of the file.

  - The change also disables the workaround for
    -Wanalyzer-use-of-uninitialized-value. But the bug that has been fixed
    for gcc 17 is in the LTO subsystem [1], whereas the bug regarding
    -Wanalyzer-use-of-uninitialized-value was reported [2] without -flto
    and therefore most likely is in the analyzer subsystem, not in the
    LTO subsystem.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922
[2] https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00140.html


I'm therefore fixing it like this. Hope you agree.


2026-07-18  Bruno Haible  <[email protected]>

        diffseq: Restore gcc 17 -fanalyzer customization (regr. yesterday).
        * lib/diffseq.h: Don't assume that -Wanalyzer-use-of-uninitialized
        is fixed in gcc 17.

diff --git a/lib/diffseq.h b/lib/diffseq.h
index ad52d00e30..677dacc0ae 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -101,9 +101,11 @@
 /* Suppress gcc's "...may be used before initialized" warnings,
    generated by GCC versions before GCC 17 (GCC bug 80922).
    Likewise for gcc -fanalyzer's "use of uninitialized value" warnings.  */
-#if _GL_GNUC_PREREQ (4, 7) && __GNUC__ < 17
+#if _GL_GNUC_PREREQ (4, 7)
 # pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+# if __GNUC__ < 17
+#  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+# endif
 # if _GL_GNUC_PREREQ (13, 0)
 #  pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"
 # endif




Reply via email to