]> 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>
Thu, 9 Feb 2023 17:37:55 +0000 (18:37 +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 f0d757837e45666529922cdf432e8f5d8e5960ef..5b4e71ad3dae7642c8b0e1bfb780fdcd6d88211f 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 c0181abdc5080ef8e9c7558ca322bb24d613ba3e..1e6748ed8c3895cd52ef10aef0a193ec23ae9e84 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 80
+# gnulib-common.m4 serial 81
 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