]> 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 03:25:46 +0000 (04:25 +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 4f322a4670dbd3867de6dbe4b6d9641b476fb5e2..8126106a05e5911e2466c53dd4d115aeb6a1e43a 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 69e16e49d21dfa4b768a27cdc4c2c3c623c2719e..99ec9bc7c33ba228dc8c9e87ec7c58479f639167 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 73.4
+# gnulib-common.m4 serial 73.5
 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,
@@ -352,7 +352,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 _GL_HAS_C_ATTRIBUTE (maybe_unused)