From: Bruno Haible Date: Thu, 9 Feb 2023 17:37:55 +0000 (+0100) Subject: Fix compilation errors in C++ mode on macOS 12.5. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=833bf958dd12f88e936910d5cd29e7cf0046fe27;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 9aa4b2d53e..fe4d61f700 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-02-09 Bruno Haible + + 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 limits-h: Work around a clang 15 bug. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 060968dcf0..84dc0a641c 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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