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=9b75bea031f3c89f4cc8f7cbc326ea844adacaef;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 4f322a4670..8126106a05 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 69e16e49d2..99ec9bc7c3 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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)