[PATCH 42/59] Add fall-through between switch labels annotations

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Oct 17 19:13:17 GMT 2025


The clang default to warning for missing fall-through and it does
not support all comment-like annotation that gcc does.  Use a
proper attribute instead.
---
 elf/dl-exception.c                    |  4 ++--
 elf/dl-find_object.h                  |  2 +-
 elf/dl-lookup.c                       |  2 +-
 elf/ldconfig.c                        |  2 +-
 elf/rtld.c                            |  4 ++--
 iconv/gconv_charset.c                 |  2 +-
 iconvdata/cns11643.h                  |  2 +-
 inet/ruserpass.c                      |  2 +-
 intl/Makefile                         |  3 ++-
 locale/programs/charmap-kw.h          |  8 ++++----
 locale/programs/charmap.c             |  4 ++--
 locale/programs/locfile-kw.h          |  6 +++---
 locale/programs/repertoire.c          |  4 ++--
 malloc/mcheck-impl.c                  |  2 +-
 misc/mntent_r.c                       |  4 ++--
 misc/sys/cdefs.h                      | 10 ++++++++++
 nis/nis_call.c                        |  2 +-
 nptl/pthread_mutex_trylock.c          |  2 +-
 nptl/pthread_mutex_unlock.c           |  2 +-
 nss/digits_dots.c                     |  2 +-
 nss/nss_hash.c                        |  6 +++---
 posix/execvpe.c                       |  1 +
 posix/fnmatch.c                       |  2 +-
 posix/regex_internal.h                |  2 +-
 posix/wordexp.c                       |  4 ++--
 resolv/base64.c                       |  2 +-
 resolv/ns_ttl.c                       |  8 ++++----
 resolv/nss_dns/dns-host.c             |  4 ++--
 resolv/res_hconf.c                    |  1 +
 resolv/res_query.c                    |  6 +++---
 stdio-common/printf-parsemb.c         |  2 +-
 stdio-common/vfscanf-internal.c       |  4 ++--
 sunrpc/svc_tcp.c                      |  2 +-
 sunrpc/svc_unix.c                     |  2 +-
 sunrpc/xdr.c                          | 12 ++++++------
 sysdeps/aarch64/fpu/fpu_control.h     |  1 +
 sysdeps/ieee754/dbl-64/e_lgamma_r.c   | 10 +++++-----
 sysdeps/ieee754/ldbl-96/e_lgammal_r.c |  4 ++++
 sysdeps/x86/cpu-features.c            |  6 +++---
 sysdeps/x86/readelflib.c              |  2 +-
 sysdeps/x86_64/dl-machine.h           |  4 ++--
 time/strftime_l.c                     |  4 ++--
 time/strptime_l.c                     |  4 ++--
 43 files changed, 90 insertions(+), 72 deletions(-)

diff --git a/elf/dl-exception.c b/elf/dl-exception.c
index 3bdb69662a..7c9afcd039 100644
--- a/elf/dl-exception.c
+++ b/elf/dl-exception.c
@@ -134,7 +134,7 @@ _dl_exception_create_format (struct dl_exception *exception, const char *objname
 		  ++p;
 		  break;
 		}
-	      /* Fall through.  */
+	      __atribute_fallthrough__;
 	    case 'x':
 	      length += INT_WIDTH / 4;
 	      break;
@@ -219,7 +219,7 @@ _dl_exception_create_format (struct dl_exception *exception, const char *objname
 		  ++p;
 		  break;
 		}
-	       /* FALLTHROUGH */
+	      __atribute_fallthrough__;
             default:
               _dl_fatal_printf ("Fatal error:"
                                 " invalid format in exception string\n");
diff --git a/elf/dl-find_object.h b/elf/dl-find_object.h
index d9d75c4ad9..1ae562542d 100644
--- a/elf/dl-find_object.h
+++ b/elf/dl-find_object.h
@@ -136,7 +136,7 @@ _dl_find_object_from_map (struct link_map *l,
           atomic_store_relaxed (&result->sframe,
                                 (void *) (ph->p_vaddr + l->l_addr));
           read_seg |= 2;
-          /* Fall through.  */
+	  __atribute_fallthrough__;
         default:
           break;
         }
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index c32362da4c..fc8fb61ba8 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -490,7 +490,7 @@ do_lookup_x (const char *undef_name, unsigned int new_hash,
 		    }
 		  break;
 		}
-	      /* FALLTHROUGH */
+	      __atribute_fallthrough__;
 	    case STB_GLOBAL:
 	      /* Global definition.  Just what we need.  */
 	      result->s = sym;
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 39b154c72c..4e813b879d 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1151,7 +1151,7 @@ parse_conf_include (const char *config_file, unsigned int lineno,
 
     case GLOB_NOSPACE:
       errno = ENOMEM;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case GLOB_ABORTED:
       if (opt_verbose)
 	error (0, errno, _("%s:%u: cannot read directory %s"),
diff --git a/elf/rtld.c b/elf/rtld.c
index 8b472e9c0c..e1894c680f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2755,10 +2755,10 @@ print_statistics_item (const char *title, hp_timing_t time,
     {
     case 3:
       *wp++ = *cp++;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case 2:
       *wp++ = *cp++;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case 1:
       *wp++ = '.';
       *wp++ = *cp++;
diff --git a/iconv/gconv_charset.c b/iconv/gconv_charset.c
index 89de93d689..6401905422 100644
--- a/iconv/gconv_charset.c
+++ b/iconv/gconv_charset.c
@@ -47,7 +47,7 @@ find_suffix (char *s)
       {
         case '/':
           slash_count++;
-          /* Fallthrough */
+	  __atribute_fallthrough__;
         case ',':
           suffix_term = &s[i];
       }
diff --git a/iconvdata/cns11643.h b/iconvdata/cns11643.h
index d4b6f2b433..362a41622b 100644
--- a/iconvdata/cns11643.h
+++ b/iconvdata/cns11643.h
@@ -220,7 +220,7 @@ ucs4_to_cns11643 (uint32_t wch, unsigned char *s, size_t avail)
       if (cp[0] != '\0')
 	break;
       /* Let's try the other planes.  */
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case 0x3400 ... 0x4dff:
     case 0x9f9d ... 0x9fa5:
       /* Let's try the other planes.  */
diff --git a/inet/ruserpass.c b/inet/ruserpass.c
index 903fc966fd..397455ecf5 100644
--- a/inet/ruserpass.c
+++ b/inet/ruserpass.c
@@ -125,7 +125,7 @@ next:
 
 	case DEFAULT:
 		usedefault = 1;
-		/* FALL THROUGH */
+		__atribute_fallthrough__;
 
 	case MACHINE:
 		if (!usedefault) {
diff --git a/intl/Makefile b/intl/Makefile
index 5aa42597f5..1d9365e241 100644
--- a/intl/Makefile
+++ b/intl/Makefile
@@ -159,7 +159,8 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
 
 CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \
 	    -D'LOCALE_ALIAS_PATH="$(localedir)"' \
-	    -Wno-unused-but-set-variable
+	    -Wno-unused-but-set-variable \
+	    -Wno-implicit-fallthrough
 BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output
 
 $(inst_localedir)/locale.alias: locale.alias $(+force)
diff --git a/locale/programs/charmap-kw.h b/locale/programs/charmap-kw.h
index 505b364d88..a311dcec41 100644
--- a/locale/programs/charmap-kw.h
+++ b/locale/programs/charmap-kw.h
@@ -104,19 +104,19 @@ hash (register const char *str, register size_t len)
   switch (hval)
     {
       default:
-        hval += asso_values[(unsigned char)str[8]];
-      /*FALLTHROUGH*/
+       hval += asso_values[(unsigned char)str[8]];
+      __atribute_fallthrough__;
       case 8:
       case 7:
       case 6:
       case 5:
         hval += asso_values[(unsigned char)str[4]];
-      /*FALLTHROUGH*/
+      __atribute_fallthrough__;
       case 4:
       case 3:
       case 2:
         hval += asso_values[(unsigned char)str[1]];
-      /*FALLTHROUGH*/
+      __atribute_fallthrough__;
       case 1:
         hval += asso_values[(unsigned char)str[0]];
         break;
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index 7768a7a7fc..525ec452ff 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -548,7 +548,7 @@ character sets with locking states are not supported"));
 	      state = 4;
 	      continue;
 	    }
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 
 	case 5:
 	  if (nowtok != tok_charcode)
@@ -712,7 +712,7 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	      state = 95;
 	      continue;
 	    }
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 
 	case 96:
 	  if (nowtok != tok_number)
diff --git a/locale/programs/locfile-kw.h b/locale/programs/locfile-kw.h
index 9460a43ab1..14c54eb043 100644
--- a/locale/programs/locfile-kw.h
+++ b/locale/programs/locfile-kw.h
@@ -105,18 +105,18 @@ hash (register const char *str, register size_t len)
     {
       default:
         hval += asso_values[(unsigned char)str[8]];
-      /*FALLTHROUGH*/
+      __atribute_fallthrough__;
       case 8:
       case 7:
       case 6:
       case 5:
         hval += asso_values[(unsigned char)str[4]];
-      /*FALLTHROUGH*/
+      __atribute_fallthrough__;
       case 4:
       case 3:
       case 2:
         hval += asso_values[(unsigned char)str[1]];
-      /*FALLTHROUGH*/
+      __atribute_fallthrough__;
       case 1:
         hval += asso_values[(unsigned char)str[0]];
         break;
diff --git a/locale/programs/repertoire.c b/locale/programs/repertoire.c
index 7ed8c915dd..327de5fd3f 100644
--- a/locale/programs/repertoire.c
+++ b/locale/programs/repertoire.c
@@ -206,7 +206,7 @@ argument to <%s> must be a single character"),
 
 	  /* Otherwise we start reading the character definitions.  */
 	  state = 2;
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 
 	case 2:
 	  /* We are now are in the body.  Each line
@@ -254,7 +254,7 @@ argument to <%s> must be a single character"),
 	      state = 4;
 	      continue;
 	    }
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 
 	case 5:
 	  /* We expect a value of the form <Uxxxx> or <Uxxxxxxxx> where
diff --git a/malloc/mcheck-impl.c b/malloc/mcheck-impl.c
index a874211e78..e5ca7c5ce8 100644
--- a/malloc/mcheck-impl.c
+++ b/malloc/mcheck-impl.c
@@ -389,7 +389,7 @@ __mcheck_initialize (void (*func) (enum mcheck_status), bool in_pedantic)
     case -1:
       /* Called before the first malloc was called.  */
       __debug_free (__debug_malloc (0));
-      /* FALLTHROUGH */
+      __atribute_fallthrough__;
     case 0:
       /* Called through the initializer hook.  */
       __malloc_debug_enable (MALLOC_MCHECK_HOOK);
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index f36c2f534e..cb8b1b9cac 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -167,10 +167,10 @@ get_mnt_entry (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
     {
     case 0:
       mp->mnt_freq = 0;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case 1:
       mp->mnt_passno = 0;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case 2:
       break;
     }
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 215ff937ee..94d4cb852b 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -883,4 +883,14 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
 # define __attribute_struct_may_alias__
 #endif
 
+/* Annotate fall-through switch labels to avoid error with
+   -Wimplicit-fallthrough.  */
+#ifndef FALLTHROUGH
+# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
+#  define __atribute_fallthrough__  __attribute__ ((__fallthrough__))
+# else
+#  define __atribute_fallthrough__  ((void) 0)
+# endif
+#endif
+
 #endif	 /* sys/cdefs.h */
diff --git a/nis/nis_call.c b/nis/nis_call.c
index f77ecec709..66bfa54b13 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -324,7 +324,7 @@ __do_niscall3 (dir_binding *dbp, u_long prog, xdrproc_t xargs, caddr_t req,
 		}
 	      /* Yes, the missing break is correct. If we doesn't have to
 		 start a callback, look if we have to search another server */
-	      /* Fall through.  */
+	      __atribute_fallthrough__;
 	    case NIS_LOOKUP:
 	    case NIS_ADD:
 	    case NIS_MODIFY:
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
index dbb8fcc754..e77142bab8 100644
--- a/nptl/pthread_mutex_trylock.c
+++ b/nptl/pthread_mutex_trylock.c
@@ -68,7 +68,7 @@ ___pthread_mutex_trylock (pthread_mutex_t *mutex)
 
     case PTHREAD_MUTEX_TIMED_NP:
       FORCE_ELISION (mutex, goto elision);
-      /*FALL THROUGH*/
+      __atribute_fallthrough__;
     case PTHREAD_MUTEX_ADAPTIVE_NP:
     case PTHREAD_MUTEX_ERRORCHECK_NP:
       if (lll_trylock (mutex->__data.__lock) != 0)
diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c
index 60bea80d20..2811149133 100644
--- a/nptl/pthread_mutex_unlock.c
+++ b/nptl/pthread_mutex_unlock.c
@@ -319,7 +319,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
       if (mutex->__data.__owner != THREAD_GETMEM (THREAD_SELF, tid)
 	  || (mutex->__data.__lock & ~ PTHREAD_MUTEX_PRIO_CEILING_MASK) == 0)
 	return EPERM;
-      /* FALLTHROUGH */
+      __atribute_fallthrough__;
 
     case PTHREAD_MUTEX_PP_NORMAL_NP:
     case PTHREAD_MUTEX_PP_ADAPTIVE_NP:
diff --git a/nss/digits_dots.c b/nss/digits_dots.c
index e27c57233b..677d70abb9 100644
--- a/nss/digits_dots.c
+++ b/nss/digits_dots.c
@@ -230,7 +230,7 @@ __nss_hostname_digits_dots_context (struct resolv_context *ctx,
 		  addr_size = IN6ADDRSZ;
 		  break;
 		}
-	      /* FALLTHROUGH */
+	      __atribute_fallthrough__;
 
 	    case AF_INET:
 	      /* This is not possible.  We cannot represent an IPv6 address
diff --git a/nss/nss_hash.c b/nss/nss_hash.c
index a0bec72668..43bd9e028d 100644
--- a/nss/nss_hash.c
+++ b/nss/nss_hash.c
@@ -52,13 +52,13 @@ __nss_hash (const void *keyarg, size_t len)
 	case 0:
 	  /* h starts out as zero so no need to include the multiply. */
 	  h = *key++;
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 	case 3:
 	  HASHC;
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 	case 2:
 	  HASHC;
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 	case 1:
 	  HASHC;
 	  /* FALLTHROUGH */
diff --git a/posix/execvpe.c b/posix/execvpe.c
index 20a178c1d3..ca13561607 100644
--- a/posix/execvpe.c
+++ b/posix/execvpe.c
@@ -149,6 +149,7 @@ __execvpe_common (const char *file, char *const argv[], char *const envp[],
 	     up finding no executable we can use, we want to diagnose
 	     that we did find one but were denied access.  */
 	    got_eacces = true;
+	    __atribute_fallthrough__;
 	  case ENOENT:
 	  case ESTALE:
 	  case ENOTDIR:
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index 32ad3ff23a..0828509e6a 100644
--- a/posix/fnmatch.c
+++ b/posix/fnmatch.c
@@ -61,7 +61,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 #endif
 
 #ifdef _LIBC
-# if __GNUC__ >= 7
+# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
 #  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
 #  define FALLTHROUGH ((void) 0)
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 722da1b7d2..6664ec6fd8 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -834,7 +834,7 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 #endif /* RE_ENABLE_I18N */
 
 #ifdef _LIBC
-# if __GNUC__ >= 7
+# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
 #  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
 #  define FALLTHROUGH ((void) 0)
diff --git a/posix/wordexp.c b/posix/wordexp.c
index a69b732801..08dc62b08e 100644
--- a/posix/wordexp.c
+++ b/posix/wordexp.c
@@ -783,7 +783,7 @@ parse_arith (char **word, size_t *word_length, size_t *max_length,
 
 	case '(':
 	  ++paren_depth;
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	default:
 	  expr = w_addchar (expr, &expr_length, &expr_maxlen, words[*offset]);
 	  if (expr == NULL)
@@ -2103,7 +2103,7 @@ parse_backtick (char **word, size_t *word_length, size_t *max_length,
 
 	case '\'':
 	  squoting = 1 - squoting;
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	default:
 	  comm = w_addchar (comm, &comm_length, &comm_maxlen, words[*offset]);
 	  if (comm == NULL)
diff --git a/resolv/base64.c b/resolv/base64.c
index 11463235c8..2ae2a5b2c6 100644
--- a/resolv/base64.c
+++ b/resolv/base64.c
@@ -275,7 +275,7 @@ b64_pton (char const *src, u_char *target, size_t targsize)
 				return (-1);
 			ch = *src++;		/* Skip the = */
 			/* Fall through to "single trailing =" case. */
-			/* FALLTHROUGH */
+			__atribute_fallthrough__;
 
 		case 3:		/* Valid, means two bytes of info */
 			/*
diff --git a/resolv/ns_ttl.c b/resolv/ns_ttl.c
index d29d9dc00c..4e3a112879 100644
--- a/resolv/ns_ttl.c
+++ b/resolv/ns_ttl.c
@@ -113,13 +113,13 @@ ns_parse_ttl(const char *src, u_long *dst) {
 			ch = toupper(ch);
 		switch (ch) {
 		case 'W':  tmp *= 7;
-		  /* Fall through.  */
+		   __atribute_fallthrough__;
 		case 'D':  tmp *= 24;
-		  /* Fall through.  */
+		   __atribute_fallthrough__;
 		case 'H':  tmp *= 60;
-		  /* Fall through.  */
+		   __atribute_fallthrough__;
 		case 'M':  tmp *= 60;
-		  /* Fall through.  */
+		   __atribute_fallthrough__;
 		case 'S':  break;
 		default:   goto einval;
 		}
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 14da73ee1d..fcd8c927f8 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -235,7 +235,7 @@ gethostbyname3_context (struct resolv_context *ctx,
 	case EMFILE:
 	case ENFILE:
 	  h_errno = NETDB_INTERNAL;
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case ECONNREFUSED:
 	case ETIMEDOUT:
 	  status = NSS_STATUS_UNAVAIL;
@@ -444,7 +444,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
 	case EMFILE:
 	case ENFILE:
 	  h_errno = NETDB_INTERNAL;
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case ECONNREFUSED:
 	case ETIMEDOUT:
 	  status = NSS_STATUS_UNAVAIL;
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index 186af81690..b8e7bb90fb 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -146,6 +146,7 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args)
 	      free (buf);
 	      return NULL;
 	    }
+	  __atribute_fallthrough__;
 	default:
 	  break;
 	}
diff --git a/resolv/res_query.c b/resolv/res_query.c
index bd55453552..0db9611c8e 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -277,7 +277,7 @@ __res_context_query (struct resolv_context *ctx, const char *name,
 			    || (hp2->rcode == NOERROR
 				&& ntohs (hp2->ancount) != 0))
 				goto success;
-			/* FALLTHROUGH */
+			__atribute_fallthrough__;
 		case REFUSED:
 		default:
 			RES_SET_H_ERRNO(statp, NO_RECOVERY);
@@ -477,7 +477,7 @@ __res_context_search (struct resolv_context *ctx,
 			switch (statp->res_h_errno) {
 			case NO_DATA:
 				got_nodata++;
-				/* FALLTHROUGH */
+				__atribute_fallthrough__;
 			case HOST_NOT_FOUND:
 				/* keep trying */
 				break;
@@ -487,7 +487,7 @@ __res_context_search (struct resolv_context *ctx,
 					got_servfail++;
 					break;
 				}
-				/* FALLTHROUGH */
+				__atribute_fallthrough__;
 			default:
 				/* anything else implies that we're done */
 				done++;
diff --git a/stdio-common/printf-parsemb.c b/stdio-common/printf-parsemb.c
index a7ba52a9fa..2c7cbcb358 100644
--- a/stdio-common/printf-parsemb.c
+++ b/stdio-common/printf-parsemb.c
@@ -272,7 +272,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
 	if (*format != L_('l'))
 	  break;
 	++format;
-	/* FALLTHROUGH */
+	__atribute_fallthrough__;
       case L_('L'):
 	/* doubles are long doubles, and ints are long long ints.  */
       case L_('q'):
diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c
index c6361f74e0..fc292df6ca 100644
--- a/stdio-common/vfscanf-internal.c
+++ b/stdio-common/vfscanf-internal.c
@@ -915,7 +915,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
 
 	      break;
 	    }
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 	case L_('C'):
 	  if (width == -1)
 	    width = 1;
@@ -1258,7 +1258,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
 		}
 	      break;
 	    }
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 
 	case L_('S'):
 	  {
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index 663b34a71c..d987649a06 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -334,7 +334,7 @@ readtcp (char *xprtptr, char *buf, int len)
 	case -1:
 	  if (errno == EINTR)
 	    continue;
-	  /*FALLTHROUGH*/
+	  __atribute_fallthrough__;
 	case 0:
 	  goto fatal_err;
 	default:
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index c97880c012..b386071dc4 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -440,7 +440,7 @@ readunix (char *xprtptr, char *buf, int len)
 	case -1:
 	  if (errno == EINTR)
 	    continue;
-	  /*FALLTHROUGH*/
+	  __atribute_fallthrough__;
 	case 0:
 	  goto fatal_err;
 	default:
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
index a76094d6da..b986c81de8 100644
--- a/sunrpc/xdr.c
+++ b/sunrpc/xdr.c
@@ -113,7 +113,7 @@ xdr_int (XDR *xdrs, int *ip)
 	  return FALSE;
 	}
       *ip = (int) l;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case XDR_FREE:
       return TRUE;
     }
@@ -153,7 +153,7 @@ xdr_u_int (XDR *xdrs, u_int *up)
 	  return FALSE;
 	}
       *up = (u_int) (u_long) l;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     case XDR_FREE:
       return TRUE;
     }
@@ -508,7 +508,7 @@ xdr_enum (XDR *xdrs, enum_t *ep)
 	      return FALSE;
 	    }
 	  *ep = l;
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case XDR_FREE:
 	  return TRUE;
 
@@ -631,7 +631,7 @@ xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
 	  (void) __fxprintf (NULL, "%s: %s", __func__, _("out of memory\n"));
 	  return FALSE;
 	}
-      /* Fall through.  */
+      __atribute_fallthrough__;
 
     case XDR_ENCODE:
       return xdr_opaque (xdrs, sp, nodesize);
@@ -752,7 +752,7 @@ xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
 	{
 	  return TRUE;		/* already free */
 	}
-      /* fall through... */
+      __atribute_fallthrough__;
     case XDR_ENCODE:
       if (sp == NULL)
 	return FALSE;
@@ -792,7 +792,7 @@ xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
 	  return FALSE;
 	}
       sp[size] = 0;
-      /* Fall through.  */
+      __atribute_fallthrough__;
 
     case XDR_ENCODE:
       return xdr_opaque (xdrs, sp, size);
diff --git a/sysdeps/aarch64/fpu/fpu_control.h b/sysdeps/aarch64/fpu/fpu_control.h
index a93dbf5efa..2ed6ba6b52 100644
--- a/sysdeps/aarch64/fpu/fpu_control.h
+++ b/sysdeps/aarch64/fpu/fpu_control.h
@@ -20,6 +20,7 @@
 #define _AARCH64_FPU_CONTROL_H
 
 #include <features.h>
+#include <sys/types.h>
 
 /* Macros for accessing the FPCR and FPSR.  */
 
diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index 0b0c4e6f4c..6f48fc3320 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -282,11 +282,11 @@ __ieee754_lgamma_r(double x, int *signgamp)
 	    r = half*y+p/q;
 	    z = one;	/* lgamma(1+s) = log(s) + lgamma(s) */
 	    switch(i) {
-	    case 7: z *= (y+6.0);	/* FALLTHRU */
-	    case 6: z *= (y+5.0);	/* FALLTHRU */
-	    case 5: z *= (y+4.0);	/* FALLTHRU */
-	    case 4: z *= (y+3.0);	/* FALLTHRU */
-	    case 3: z *= (y+2.0);	/* FALLTHRU */
+	    case 7: z *= (y+6.0);	__atribute_fallthrough__;
+	    case 6: z *= (y+5.0);	__atribute_fallthrough__;
+	    case 5: z *= (y+4.0);	__atribute_fallthrough__;
+	    case 4: z *= (y+3.0);	__atribute_fallthrough__;
+	    case 3: z *= (y+2.0);
 		    r += __ieee754_log(z); break;
 	    }
     /* 8.0 <= x < 2**58 */
diff --git a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
index d4fd7f5272..6c9bf0d691 100644
--- a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
@@ -402,12 +402,16 @@ __ieee754_lgammal_r (long double x, int *signgamp)
 	{
 	case 7:
 	  z *= (y + 6.0);	/* FALLTHRU */
+	  __atribute_fallthrough__;
 	case 6:
 	  z *= (y + 5.0);	/* FALLTHRU */
+	  __atribute_fallthrough__;
 	case 5:
 	  z *= (y + 4.0);	/* FALLTHRU */
+	  __atribute_fallthrough__;
 	case 4:
 	  z *= (y + 3.0);	/* FALLTHRU */
+	  __atribute_fallthrough__;
 	case 3:
 	  z *= (y + 2.0);	/* FALLTHRU */
 	  r += __ieee754_logl (z);
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index b67ef541dd..30485c7ac4 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -798,7 +798,7 @@ init_cpu_features (struct cpu_features *cpu_features)
 		 processor.  */
 	      if (stepping > 0xc)
 		break;
-	      /* Fall through.  */
+	      __atribute_fallthrough__;
 	    case INTEL_BIGCORE_SKYLAKE:
 	      /* Disable Intel TSX and enable RTM_ALWAYS_ABORT for
 		 processors listed in:
@@ -937,7 +937,7 @@ disable_tsx:
 	     non-temporal on all Skylake servers. */
 	  cpu_features->preferred[index_arch_Avoid_Non_Temporal_Memset]
 	    |= bit_arch_Avoid_Non_Temporal_Memset;
-	  /* fallthrough */
+	  __atribute_fallthrough__;
 	case INTEL_BIGCORE_COMETLAKE:
 	case INTEL_BIGCORE_SKYLAKE:
 	case INTEL_BIGCORE_KABYLAKE:
@@ -1091,7 +1091,7 @@ disable_tsx:
 	      /* Yongfeng and Shijidadao mircoarch tuning.  */
 	    case 0x5b:
 	      cpu_features->cachesize_non_temporal_divisor = 2;
-	      /* fallthrough */
+	      __atribute_fallthrough__;
 	    case 0x6b:
 	      cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
 		  &= ~bit_arch_AVX_Fast_Unaligned_Load;
diff --git a/sysdeps/x86/readelflib.c b/sysdeps/x86/readelflib.c
index acb25d710b..b38e692244 100644
--- a/sysdeps/x86/readelflib.c
+++ b/sysdeps/x86/readelflib.c
@@ -44,7 +44,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
     case EM_386:
       if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
 	break;
-      /* Fall through.  */
+      __atribute_fallthrough__;
     default:
       error (0, 0, _("%s is for unknown machine %d.\n"),
 	     file_name, elf_header->e_machine);
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 572a1a7395..2133e4417d 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -313,7 +313,7 @@ and creates an unsatisfiable circular dependency.\n",
 	{
 	case R_X86_64_JUMP_SLOT:
 	  map->l_has_jump_slot_reloc = true;
-	  /* fallthrough */
+	  __atribute_fallthrough__;
 	case R_X86_64_GLOB_DAT:
 	  *reloc_addr = value;
 	  break;
@@ -422,7 +422,7 @@ and creates an unsatisfiable circular dependency.\n",
 	  /* Set to symbol size plus addend.  */
 	  value = sym->st_size;
 #  endif
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case R_X86_64_32:
 	  value += reloc->r_addend;
 	  *(unsigned int *) reloc_addr = value;
diff --git a/time/strftime_l.c b/time/strftime_l.c
index 5cb5f5d213..3e7803df1a 100644
--- a/time/strftime_l.c
+++ b/time/strftime_l.c
@@ -1093,7 +1093,7 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format,
 #if !defined _NL_CURRENT && HAVE_STRFTIME
 	  format_char = L_('p');
 #endif
-	  /* FALLTHROUGH */
+	  __atribute_fallthrough__;
 
 	case L_('p'):
 	  if (change_case)
@@ -1433,7 +1433,7 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format,
 
 	case L_('\0'):		/* GNU extension: % at end of format.  */
 	    --f;
-	    /* Fall through.  */
+	    __atribute_fallthrough__;
 	default:
 	  /* Unknown format; output the format, including the '%',
 	     since this is most likely the right thing to do if a
diff --git a/time/strptime_l.c b/time/strptime_l.c
index f5e2f4f5d1..ab00daa1b9 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -552,7 +552,7 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
 	      s.decided = raw;
 	    }
 #endif
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case 'D':
 	  /* Match standard day format.  */
 	  if (!recursive (HERE_D_FMT))
@@ -706,7 +706,7 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
 	      s.decided = raw;
 	    }
 #endif
-	  /* Fall through.  */
+	  __atribute_fallthrough__;
 	case 'T':
 	  if (!recursive (HERE_T_FMT))
 	    return NULL;
-- 
2.43.0



More information about the Libc-alpha mailing list