]> Savannah Git Hosting - gnulib.git/commitdiff
Support FALLTHROUGH macro better in glibc+clang.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Mar 2023 17:22:35 +0000 (19:22 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 27 Mar 2023 17:22:35 +0000 (19:22 +0200)
* lib/fnmatch.c (FALLTHROUGH): Use __attribute__ ((__fallthrough__))
also in clang >= 10.
* lib/fts.c (FALLTHROUGH): Likewise.
* lib/regex_internal.h (FALLTHROUGH): Likewise.

ChangeLog
lib/fnmatch.c
lib/fts.c
lib/regex_internal.h

index ac69cde6e2564ca2bcb2a54e0bec4e9e14a99cb7..89736b2d990b27571341126e80b9d2ed0dd5c9de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-03-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Support FALLTHROUGH macro better in glibc+clang.
+       * lib/fnmatch.c (FALLTHROUGH): Use __attribute__ ((__fallthrough__))
+       also in clang >= 10.
+       * lib/fts.c (FALLTHROUGH): Likewise.
+       * lib/regex_internal.h (FALLTHROUGH): Likewise.
+
 2023-03-27  Bruno Haible  <bruno@clisp.org>
 
        wcsstr: Ensure worst-case linear execution time.
index 7c9c4e0f244b60ffed99bb46efb6589be91b9bde..32cfb48d0f4b7a2d4d00aabf82d558e6509bbe98 100644 (file)
@@ -64,7 +64,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 #endif
 
 #ifdef _LIBC
-# if __GNUC__ >= 7
+# if __glibc_has_attribute (__fallthrough__)
 #  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
 #  define FALLTHROUGH ((void) 0)
index 794a4f75d79651a449b50bd46da2c86a269c15d4..3fffb45d701e120e5ddde9015e024ade3234ed06 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -203,7 +203,7 @@ enum Fts_stat
 #endif
 
 #ifdef _LIBC
-# if __GNUC__ >= 7
+# if __glibc_has_attribute (__fallthrough__)
 #  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
 #  define FALLTHROUGH ((void) 0)
index 149ec2e868a345359a6a714f4d8cb9059e8a64c9..ae9257eac002323727d1a1c3cce10b8acc8eab0d 100644 (file)
@@ -822,7 +822,7 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 
 #ifdef _LIBC
-# if __GNUC__ >= 7
+# if __glibc_has_attribute (__fallthrough__)
 #  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
 #  define FALLTHROUGH ((void) 0)