summaryrefslogtreecommitdiff
path: root/lib/fts.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-01-19 18:35:30 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-01-19 18:37:02 -0800
commit5c52f00c69f39fe86ec087654893087a83290ee7 (patch)
treee96d9178880d21afc906d326e01497b89387403c /lib/fts.c
parent2ef5a9b4b25381bc4805adf13f9f3a266af9c313 (diff)
downloadgnulib-5c52f00c69f39fe86ec087654893087a83290ee7.tar.gz
fnmatch, regex, fts: FALLTHROUGH consistency
Be more consistent about how FALLTHROUGH is defined. For Gnulib, use attribute.h. For glibc, use __GNUC__ >= 7. Problem for glibc reported by Vaseeharan Vinayagamoorthy in: https://sourceware.org/pipermail/libc-alpha/2021-January/121778.html * lib/fnmatch.c (FALLTHROUGH) [_LIBC]: * lib/regex_internal.h (FALLTHROUGH) [_LIBC]: Don’t worry about Clang, as it’s not needed and provokes GCC. * lib/fts.c (FALLTHROUGH) [!_LIBC]: * lib/regex_internal.h (FALLTHROUGH) [!_LIBC]: Rely on attribute.h for FALLTHROUGH * modules/regex: Depend on attribute module.
Diffstat (limited to 'lib/fts.c')
-rw-r--r--lib/fts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fts.c b/lib/fts.c
index 8a9b5ed961..e6603f40e7 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -200,8 +200,8 @@ enum Fts_stat
while (false)
#endif
-#ifndef FALLTHROUGH
-# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
+#ifdef _LIBC
+# if __GNUC__ >= 7
# define FALLTHROUGH __attribute__ ((__fallthrough__))
# else
# define FALLTHROUGH ((void) 0)