]> Savannah Git Hosting - gnulib.git/commitdiff
assert-h: Fix compilation error with gcc >= 13 on Solaris 11.
authorBruno Haible <bruno@clisp.org>
Tue, 14 Jan 2025 21:47:43 +0000 (22:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 18 Jan 2025 08:34:25 +0000 (09:34 +0100)
Reported by Pádraig Brady <P@draigBrady.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00120.html>.

* m4/assert_h.m4 (gl_ASSERT_H): Don't assume that on Solaris with gcc or
clang, static_assert works: /usr/include/assert.h is in the way.

ChangeLog
m4/assert_h.m4

index eefb49a616ccbd02828d55e47f1274d3013c81d3..e49455b109cb8b78817200151b1deadd68ca9b52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-01-14  Bruno Haible  <bruno@clisp.org>
+
+       assert-h: Fix compilation error with gcc >= 13 on Solaris 11.
+       Reported by Pádraig Brady <P@draigBrady.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00120.html>.
+       * m4/assert_h.m4 (gl_ASSERT_H): Don't assume that on Solaris with gcc or
+       clang, static_assert works: /usr/include/assert.h is in the way.
+
 2025-01-12  Pádraig Brady  <P@draigBrady.com>
 
        progname: also set program_invocation_short_name
index fbf8d75e315952f58563482356e7e188592228dd..f7b1a5fb58dc13d7e4ae193e556e04e37929a6a5 100644 (file)
@@ -1,6 +1,6 @@
 # assert_h.m4
-# serial 4
-dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
+# serial 5
+dnl Copyright (C) 2011-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -63,11 +63,13 @@ AC_DEFUN([gl_ASSERT_H],
 [#if (!(defined __clang__ \
        ? (defined __cplusplus \
           ? __cplusplus >= 201703L \
-          : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16) \
+          : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16 \
+            && !defined __sun) \
        : (defined __GNUC__ \
           ? (defined __cplusplus \
              ? __cplusplus >= 201103L && __GNUG__ >= 6 \
-             : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13) \
+             : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \
+               && !defined __sun) \
           : defined HAVE_C_STATIC_ASSERT)) \
      && !defined assert \
      && (!defined __cplusplus \