bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Port FALLTHROUGH to Mac OS X 10.9


From: Bruno Haible
Subject: Port FALLTHROUGH to Mac OS X 10.9
Date: Mon, 29 Jan 2024 18:27:45 +0100

Ryan Carsten Schmidt (from the MacPorts project) reported in
<https://savannah.gnu.org/bugs/?63866> a compilation error in GNU gettext:

  x-c.c:1561:15: error: expected expression
                FALLTHROUGH;
                ^
  ../libgrep/attribute.h:165:21: note: expanded from macro 'FALLTHROUGH'
  #define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
                      ^
  ../config.h:3211:37: note: expanded from macro '_GL_ATTRIBUTE_FALLTHROUGH'
  #  define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
                                      ^

He found the fix: Test for a higher minimum __apple_build_version__. Thanks!
It should apply to all uses of __has_attribute in Gnulib.


2024-01-29  Bruno Haible  <bruno@clisp.org>

        Port FALLTHROUGH to Mac OS X 10.9.
        Report and fix by Ryan Carsten Schmidt <gnulib@ryandesign.com>
        at <https://savannah.gnu.org/bugs/?63866>.
        * m4/gnulib-common.m4 (gl_COMMON_BODY): For _GL_HAS_ATTRIBUTE, don't use
        __has_attribute for Apple clang versions < 7000000.
        * lib/cdefs.h (__glibc_has_attribute): Don't use __has_attribute for
        Apple clang versions < 7000000.

diff --git a/lib/cdefs.h b/lib/cdefs.h
index 87ddce319d..6cc5581c0e 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -42,7 +42,7 @@
 #if (defined __has_attribute \
      && (!defined __clang_minor__ \
          || (defined __apple_build_version__ \
-             ? 6000000 <= __apple_build_version__ \
+             ? 7000000 <= __apple_build_version__ \
              : 5 <= __clang_major__)))
 # define __glibc_has_attribute(attr) __has_attribute (attr)
 #else
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 03d10fa51e..00691c0d6c 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 90
+# gnulib-common.m4 serial 91
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -79,7 +79,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 #if (defined __has_attribute \
      && (!defined __clang_minor__ \
          || (defined __apple_build_version__ \
-             ? 6000000 <= __apple_build_version__ \
+             ? 7000000 <= __apple_build_version__ \
              : 5 <= __clang_major__)))
 # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
 #else






reply via email to

[Prev in Thread] Current Thread [Next in Thread]