ince GCC started supporting __has_attribute in GCC 5.
Good point. I'm thus committing this in your name:
2023-03-27 Paul Eggert
Support FALLTHROUGH macro better in glibc+clang.
* lib/fnmatch.c (FALLTHROUGH): Use __attribute__ ((__fallthrough__))
also in clang >= 1
On 2023-03-25 14:24, Paul Eggert wrote:
# if __GNUC_PREREQ (7,0) || __glibc_has_attribute (__fallthrough__)
Come to think of it this could be simplified further, to just:
# if __glibc_has_attribute (__fallthrough__)
since GCC started supporting __has_attribute in GCC 5.
On 2023-02-26 08:43, Bruno Haible wrote:
-# if __GNUC__ >= 7
+# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
Sorry I didn't see this earlier.
Since this is protected by #ifdef _LIBC" it might be better to do this
the glibc way. Something like the following, perhaps?
# if __GNUC_PREREQ (
Hi Paul,
Any objections against this proposed patch from
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00178.html> ?
> 2023-02-26 Bruno Haible
>
> Support FALLTHROUGH macro better in glibc+clang.
> * lib/fnmatch.c (FALLTHROUGH): Use __attribute__
-toolchains-and-glibc/
https://www.collabora.com/news-and-blog/blog/2023/01/17/a-brave-new-world-building-glibc-with-llvm/
To help going in this direction, how about this patch? Paul, do you object?
2023-02-26 Bruno Haible
Support FALLTHROUGH macro better in glibc+clang.
* lib/fnmatch.c