From d96c65530f3c5f8f0ad7e76b581f7f5f597366c9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 14 Jan 2025 22:47:43 +0100 Subject: [PATCH] assert-h: Fix compilation error with gcc >= 13 on Solaris 11. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Pádraig Brady in . * 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 | 8 ++++++++ m4/assert_h.m4 | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64da89068c..0c3047361b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-01-14 Bruno Haible + + assert-h: Fix compilation error with gcc >= 13 on Solaris 11. + Reported by Pádraig Brady in + . + * 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 Collin Funk crc: Respect Automake's silent-rules. diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index 91f446e7f6..e77524caff 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -1,5 +1,5 @@ # assert_h.m4 -# serial 4 +# 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, @@ -64,11 +64,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 \ -- 2.39.5