]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation errors in C++ mode on macOS 12.5.
authorBruno Haible <bruno@clisp.org>
Thu, 9 Feb 2023 17:37:55 +0000 (18:37 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 10 Feb 2023 02:45:31 +0000 (03:45 +0100)
* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't define
_GL_ATTRIBUTE_MAYBE_UNUSED to [[__maybe_unused__]] if the compiler is
an Apple variant of clang.

ChangeLog
m4/gnulib-common.m4

index 9aa4b2d53e20a3260d45ebf4788f3c3c043c1be2..fe4d61f70032e612bfa618c9d755b2e006b22994 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-02-09  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation errors in C++ mode on macOS 12.5.
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Don't define
+       _GL_ATTRIBUTE_MAYBE_UNUSED to [[__maybe_unused__]] if the compiler is
+       an Apple variant of clang.
+
 2023-02-09  Bruno Haible  <bruno@clisp.org>
 
        limits-h: Work around a clang 15 bug.
index 060968dcf008fe28ac16db97ecc231acb86e62f5..84dc0a641c62cbfe5fe797897e0a70472d166ae7 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 75c
+# gnulib-common.m4 serial 75d
 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -356,7 +356,7 @@ AC_DEFUN([gl_COMMON_BODY], [
    [[__maybe_unused__]] nevertheless produces a warning.  */
 #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
 # if defined __clang__ && defined __cplusplus
-#  if __clang_major__ >= 10
+#  if !defined __apple_build_version__ && __clang_major__ >= 10
 #   define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
 #  endif
 # elif defined __has_c_attribute