Clang bug 16778 (formerly 16404) apparently survived on some
platforms even in Clang 14 and later.  The bug appears to be fixed
in Clang 21.  Work around the bug on older platforms.
Also, update some URLs as Clang renumbered its bugs.
* lib/intprops-internal.h (_GL_HAS_BUILTIN_MUL_OVERFLOW):
Define to 0 (not 1) for Clang 14 through 20.
---
 ChangeLog               | 18 +++++++++++++++---
 lib/intprops-internal.h |  8 ++++----
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 855cd6912f..220ce6e18c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-11-18  Paul Eggert  <[email protected]>
+
+       intprops: port better to Clang < 21
+       Clang bug 16778 (formerly 16404) apparently survived on some
+       platforms even in Clang 14 and later.  The bug appears to be fixed
+       in Clang 21.  Work around the bug on older platforms.
+       Also, update some URLs as Clang renumbered its bugs.
+       * lib/intprops-internal.h (_GL_HAS_BUILTIN_MUL_OVERFLOW):
+       Define to 0 (not 1) for Clang 14 through 20.
+
 2025-11-18  Bruno Haible  <[email protected]>
 
        lib: Replace some 'continue;' statements with if/else.
@@ -75144,8 +75154,9 @@
        Test newlocale and uselocale only if both exist.
 
        glob, intprops, xalloc: work around Clang bug
-       Work around LLVM bug 16404, which is still not fixed.
-       https://llvm.org/bugs/show_bug.cgi?id=16404
+       Work around LLVM bug [16778] 16404, which is still not fixed.
+       https://github.com/llvm/llvm-project/issues/16778
+       https://bugs.llvm.org/show_bug.cgi?id=16404
        Problem reported by Nelson H. F. Beebe.
        * lib/glob.c, lib/intprops.h, lib/xalloc-oversized.h (__has_builtin):
        Remove.
@@ -78284,7 +78295,8 @@
        http://lists.gnu.org/r/emacs-devel/2016-02/msg00476.html
        * lib/stdalign.in.h (alignas): Fix typo that prevented 'alignas'
        from being defined on clang 3.7.0, which has a buggy stdalign.h.  See:
-       https://llvm.org/bugs/show_bug.cgi?id=26547
+       https://github.com/llvm/llvm-project/issues/26921
+       https://bugs.llvm.org/show_bug.cgi?id=26547
 
 2016-02-08  Paul Eggert  <[email protected]>
 
diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h
index 2609803094..856cfa534f 100644
--- a/lib/intprops-internal.h
+++ b/lib/intprops-internal.h
@@ -116,8 +116,8 @@
 #endif
 
 /* True if __builtin_mul_overflow (A, B, P) works when P is non-null.  */
-#if defined __clang_major__ && __clang_major__ < 14
-/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>.  */
+#if defined __clang_major__ && __clang_major__ < 21
+/* Work around Clang bug <https://github.com/llvm/llvm-project/issues/16778>. 
*/
 # define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
 #else
 # define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
@@ -179,9 +179,9 @@
    _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
 #endif
 
-/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
+/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25764.  See:
    https://gcc.gnu.org/PR68193
-   https://llvm.org/bugs/show_bug.cgi?id=25390
+   https://github.com/llvm/llvm-project/issues/25764
    For now, assume GCC < 14 and all Clang versions generate bogus
    warnings for _Generic.  This matters only for compilers that
    lack relevant builtins.  */
-- 
2.51.0


Reply via email to