about summary refs log tree commit diff
path: root/sysdeps/x86_64/dl-machine.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2019-02-12 10:30:34 +0000
committerJoseph Myers <joseph@codesourcery.com>2019-02-12 10:30:34 +0000
commit32db86d558193ad4ad5a00926ce3c350c89eb8df (patch)
tree477020d5e3e691134fd40d992bbf66eaa7e18347 /sysdeps/x86_64/dl-machine.h
parenta51bc4fe9da9f2b97877beb6692f7043f6c14a16 (diff)
downloadglibc-32db86d558193ad4ad5a00926ce3c350c89eb8df.tar.gz
glibc-32db86d558193ad4ad5a00926ce3c350c89eb8df.tar.xz
glibc-32db86d558193ad4ad5a00926ce3c350c89eb8df.zip
Add fall-through comments.
This patch adds fall-through comments in some cases where -Wextra
produces implicit-fallthrough warnings.

The patch is non-exhaustive.  Apart from architecture-specific code
for non-x86_64 architectures, it does not change sunrpc/xdr.c (legacy
code, probably should have such changes, but left to be dealt with
separately), or places that already had comments about the
fall-through but not matching the form expected by
-Wimplicit-fallthrough=3 (the default level with -Wextra; my
inclination is to adjust those comments to match rather than
downgrading to -Wimplicit-fallthrough=1 to allow any comment), or one
place where I thought the implicit fallthrough was not correct and so
should be handled separately as a bug fix.  I think the key thing to
consider in review of this patch is whether the fall-through is indeed
intended and correct in each place where such a comment is added.

Tested for x86_64.

	* elf/dl-exception.c (_dl_exception_create_format): Add
	fall-through comments.
	* elf/ldconfig.c (parse_conf_include): Likewise.
	* elf/rtld.c (print_statistics): Likewise.
	* locale/programs/charmap.c (parse_charmap): Likewise.
	* misc/mntent_r.c (__getmntent_r): Likewise.
	* posix/wordexp.c (parse_arith): Likewise.
	(parse_backtick): Likewise.
	* resolv/ns_ttl.c (ns_parse_ttl): Likewise.
	* sysdeps/x86/cpu-features.c (init_cpu_features): Likewise.
	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
Diffstat (limited to 'sysdeps/x86_64/dl-machine.h')
-rw-r--r--sysdeps/x86_64/dl-machine.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index d10e08a87d..95a13b35b5 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -347,6 +347,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 	  /* Set to symbol size plus addend.  */
 	  value = sym->st_size;
 # endif
+	  /* Fall through.  */
 	case R_X86_64_GLOB_DAT:
 	case R_X86_64_JUMP_SLOT:
 	  *reloc_addr = value + reloc->r_addend;
@@ -460,6 +461,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 	  /* Set to symbol size plus addend.  */
 	  value = sym->st_size;
 #  endif
+	  /* Fall through.  */
 	case R_X86_64_32:
 	  value += reloc->r_addend;
 	  *(unsigned int *) reloc_addr = value;