Evidently those FALLTHROUGHs were put in to pacify an old
version of GCC, but that’s no longer needed and nowadays
is even counterproductive.
* lib/fts.c (FALLTHROUGH): Remove; no longer used.
(leaf_optimization): Remove the FALLTHROUGHs.
* modules/fts (Depends-on): Remove ‘attribute’.
---
 ChangeLog   |  8 ++++++++
 lib/fts.c   | 13 -------------
 modules/fts |  1 -
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f19a8509e..fd8e899b93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2026-05-07  Paul Eggert  <[email protected]>
 
+       fts: pacify GCC 16 -Wfree-labels
+       Evidently those FALLTHROUGHs were put in to pacify an old
+       version of GCC, but that’s no longer needed and nowadays
+       is even counterproductive.
+       * lib/fts.c (FALLTHROUGH): Remove; no longer used.
+       (leaf_optimization): Remove the FALLTHROUGHs.
+       * modules/fts (Depends-on): Remove ‘attribute’.
+
        maint: pacify -Wuseless-cast via compound literals
        * lib/fsusage.c (PROPAGATE_ALL_ONES):
        * lib/fts-cycle.c (AD_hash):
diff --git a/lib/fts.c b/lib/fts.c
index daaa7d3e3c..98851cdaf1 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -69,7 +69,6 @@ static char sccsid[] = "@(#)fts.c       8.6 (Berkeley) 
8/14/94";
 #include <unistd.h>
 
 #if ! _LIBC
-# include "attribute.h"
 # include "fcntl--.h"
 # include "flexmember.h"
 # include "openat.h"
@@ -202,14 +201,6 @@ enum Fts_stat
     while (false)
 #endif
 
-#ifdef _LIBC
-# if __glibc_has_attribute (__fallthrough__)
-#  define FALLTHROUGH __attribute__ ((__fallthrough__))
-# else
-#  define FALLTHROUGH ((void) 0)
-# endif
-#endif
-
 static FTSENT   *fts_alloc (FTS *, const char *, size_t) internal_function;
 static FTSENT   *fts_build (FTS *, int) internal_function;
 static void      fts_lfree (FTSENT *) internal_function;
@@ -789,21 +780,17 @@ leaf_optimization (FTSENT const *p, int dir_fd)
     {
     case 0:
       /* Leaf optimization is unsafe if the file system type is unknown.  */
-      FALLTHROUGH;
     case S_MAGIC_AFS:
       /* Although AFS mount points are not counted in st_nlink, they
          act like directories.  See <https://bugs.debian.org/143111>.  */
-      FALLTHROUGH;
     case S_MAGIC_CIFS:
       /* Leaf optimization causes 'find' to abort.  See
          <https://lists.gnu.org/r/bug-gnulib/2018-04/msg00015.html>.  */
-      FALLTHROUGH;
     case S_MAGIC_NFS:
       /* NFS provides usable dirent.d_type but not necessarily for all entries
          of large directories, so as per <https://bugzilla.redhat.com/1252549>
          NFS should return true.  However st_nlink values are not accurate on
          all implementations as per <https://bugzilla.redhat.com/1299169>.  */
-      FALLTHROUGH;
     case S_MAGIC_PROC:
       /* Per <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=143111> /proc
          may have bogus stat.st_nlink values.  */
diff --git a/modules/fts b/modules/fts
index 059513f6d4..fc348c430a 100644
--- a/modules/fts
+++ b/modules/fts
@@ -11,7 +11,6 @@ m4/sys_cdefs_h.m4
 Depends-on:
 gen-header
 alignasof
-attribute
 c99
 calloc-posix
 close
-- 
2.54.0


Reply via email to