bug-gnulib
[Top][All Lists]
Advanced

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

Re: Apple LLVM 10 and `__fallthrough__`


From: Alexei Podtelezhnikov
Subject: Re: Apple LLVM 10 and `__fallthrough__`
Date: Sun, 26 Feb 2023 17:41:18 -0500

-# elif (__GNUC__ >= 7) || (__clang_major__ >= 10)
+# elif ((__GNUC__ >= 7) \
+        || (defined __apple_build_version__ \
+            ? __apple_build_version__ >= 14000000 \
+            : __clang_major__ >= 10))

Wiki suggests __apple_build_version__ >= 12000000
https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2

Would  it perhaps be better if clang used [[fallthrough]]  instead of
__attribute__((fallthrough))? They have supported [[fallthrough]]
since at least 3.5.0 circa 2014. In this particular case they are
ahead of GCC and towards the standard acceptance.
https://releases.llvm.org/3.5.0/tools/clang/docs/AttributeReference.html

There was also a suggestion on this list to use __has_attribute.
https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00267.html



reply via email to

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