]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Use fallthrough attribute.
authorJoshua Watt <jpewhacker@gmail.com>
Fri, 9 Feb 2018 16:27:18 +0000 (10:27 -0600)
committerMark Wielaard <mark@klomp.org>
Sat, 10 Feb 2018 02:19:26 +0000 (03:19 +0100)
Use __attribute__ ((fallthrough)) to indicate switch case fall through
instead of a comment. This ensures that the fallthrough warning is not
triggered even if the file is pre-processed (hence stripping the
comments) before it is compiled.

The actual fallback implementation is hidden behind a FALLBACK macro in
case the compiler doesn't support it.

Finally, the -Wimplict-fallthrough warning was upgraded to only allow
the attribute to satisfy it; a comment alone is no longer sufficient.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
49 files changed:
ChangeLog
backends/ChangeLog
backends/aarch64_retval.c
backends/alpha_retval.c
backends/arm_regs.c
backends/arm_retval.c
backends/i386_regs.c
backends/i386_retval.c
backends/ia64_retval.c
backends/linux-core-note.c
backends/m68k_retval.c
backends/ppc64_retval.c
backends/ppc_regs.c
backends/ppc_retval.c
backends/s390_retval.c
backends/sh_retval.c
backends/sparc_retval.c
backends/tilegx_retval.c
backends/x86_64_regs.c
backends/x86_64_retval.c
config/ChangeLog
config/eu.am
configure.ac
lib/ChangeLog
lib/eu-config.h
libcpu/ChangeLog
libcpu/i386_disasm.c
libdw/ChangeLog
libdw/cfi.c
libdw/dwarf_frame_register.c
libdwfl/ChangeLog
libdwfl/dwfl_report_elf.c
libdwfl/frame_unwind.c
libebl/ChangeLog
libebl/eblobjnote.c
libelf/ChangeLog
libelf/elf32_updatenull.c
libelf/elf_begin.c
libelf/elf_cntl.c
src/ChangeLog
src/addr2line.c
src/elfcompress.c
src/elflint.c
src/objdump.c
src/readelf.c
src/strings.c
tests/ChangeLog
tests/backtrace.c
tests/elfstrmerge.c

index cd1a3f2c3c80048f6e605f98f098cb764a8dd44e..279c3b2bf6adc98ef59d3b31ba9d0849b5b5536d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * configure.ac (HAVE_FALLTHROUGH): New define.
+
 2017-10-16  Mark Wielaard  <mark@klomp.org>
 
        * .gitignore: Remove tests/md5-sha1-test.
index 190ae968e4701fe4c91f9f835cf6467785c5e6eb..098bed76fe8ed174e7e3ddbe81b3a657c49c70b5 100644 (file)
@@ -1,3 +1,25 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * aarch64_retval.c (aarch64_return_value_location): Use FALLTHROUGH
+       macro instead of comment.
+       * alpha_retval.c (alpha_return_value_location): Likewise.
+       * arm_regs.c (arm_register_info): Likewise.
+       * arm_retval.c (arm_return_value_location): Likewise.
+       * i386_regs.c (i386_register_info): Likewise.
+       * i386_retval.c (i386_return_value_location): Likewise.
+       * ia64_retval.c (ia64_return_value_location): Likewise.
+       * linux-core-note.c (core_note): Likewise.
+       * m68k_retval.c (m68k_return_value_location): Likewise.
+       * ppc64_retval.c (ppc64_return_value_location): Likewise.
+       * ppc_regs.c (ppc_register_info): Likewise.
+       * ppc_retval.c (ppc_return_value_location): Likewise.
+       * s390_retval.c (s390_return_value_location): Likewise.
+       * sh_retval.c (sh_return_value_location): Likewise.
+       * sparc_retval.c (sparc_return_value_location): Likewise.
+       * tilegx_retval.c (tilegx_return_value_location): Likewise.
+       * x86_64_regs.c (x86_64_register_info): Likewise.
+       * x86_64_retval.c (x86_64_return_value_location): Likewise.
+
 2017-10-24  Mark Wielaard  <mark@klomp.org>
 
        * Makefile.am (m68k_corenote_no_Wpacked_not_aligned): New variable.
index 68de307e17110a9958e309933625e7d939bc74e5..1308340b734762d5715e5cf3585d37d34189d1c7 100644 (file)
@@ -292,7 +292,7 @@ aarch64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          assert (count > 0);
          if (count <= 4)
            return pass_hfa (locp, base_size, count);
-         /* Fall through.  */
+         FALLTHROUGH;
 
        case 1:
          /* Not a HFA.  */
index 53dbfa45470928b635e9d71ada0eb0a081cb7c40..d9bae3bcce2985357b1a7097976405e5aa7e252f 100644 (file)
@@ -85,7 +85,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -131,7 +131,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          }
       }
 
-      /* Else fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
index 21c5ad3a18fbca6ee67b5eac6ebf73cab566bdbd..a46a4c9982ccdf6ff49e16ff03c3bd2ab9e4e0db 100644 (file)
@@ -77,7 +77,7 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
 
     case 16 + 0 ... 16 + 7:
       regno += 96 - 16;
-      /* Fall through.  */
+      FALLTHROUGH;
     case 96 + 0 ... 96 + 7:
       *setname = "FPA";
       *type = DW_ATE_float;
index 7aced742c11fdb5bca8af060671c703d4694622c..1c28f016b5bc61aa788a1dee9a2c769400590a0f 100644 (file)
@@ -82,7 +82,7 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
index fd963a62b465a181814caf6497bb42830e37382d..7ec93bb9fc131d10c55fcd5859b84f6478e1f4a4 100644 (file)
@@ -92,7 +92,7 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)),
     case 5:
     case 8:
       *type = DW_ATE_address;
-      /* Fallthrough */
+      FALLTHROUGH;
     case 0 ... 3:
     case 6 ... 7:
       name[0] = 'e';
index 4aa646fe7ddeae189bf8bd05223d4e647df1c20d..32fec7281666007dd2020a0536b10d7c6b000686 100644 (file)
@@ -85,7 +85,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -123,7 +123,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
        if (size <= 8)
          return nloc_intregpair;
       }
-    /* Fallthrough */
+    FALLTHROUGH;
 
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
index dcd5f28d6cead810bdde48bc4f5e3ec49906bf5c..03ea4d89da492eb1267ed66f5a0b8f03eb53ace9 100644 (file)
@@ -260,7 +260,7 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
index 08282ba4d545b459384ff18ff3439a8985b505ae..9faae4c3594b66cf2c9e0659e13678ae09dd23fd 100644 (file)
@@ -226,7 +226,7 @@ EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name,
       if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
        break;
       /* Buggy old Linux kernels didn't terminate "LINUX".  */
-      /* Fall through. */
+      FALLTHROUGH;
 
     case sizeof "LINUX":
       if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
index c68ed02210e8bc1fd493fcd1d7bda91eee22490c..a653ba3a87e7e80bae3f9d7079303713fe70ef2e 100644 (file)
@@ -92,7 +92,7 @@ m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -135,7 +135,7 @@ m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
        if (size <= 8)
          return nloc_intregpair;
       }
-      /* Fallthrough */
+      FALLTHROUGH;
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
     case DW_TAG_union_type:
index a25198392506b9b33825703b21ce79831c194f22..eb1c11ec6da36a879fa8b1365cfd6c52b91d2108 100644 (file)
@@ -96,7 +96,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -141,7 +141,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          return nloc_intreg;
        }
 
-      /* Else fall through.  */
+      FALLTHROUGH;
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
     case DW_TAG_union_type:
@@ -161,7 +161,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
            return nloc_vmxreg;
          }
       }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_string_type:
       if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 8)
index c2d501181cc207ccecd66b35a3d38ac1475e905d..43d2534f20b0bd0e1dd8c143ccb52eefa6902b9a 100644 (file)
@@ -140,7 +140,7 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
     case 100:
       if (*bits == 32)
        return stpcpy (name, "mq") + 1 - name;
-      /* Fallthrough */
+      FALLTHROUGH;
     case 102 ... 107:
       name[0] = 's';
       name[1] = 'p';
index b14a99f118664d9312b0edd98ba0b97a9fedfcd4..39b42da12fbd7836e2bfc1578c1c687b05d5e86b 100644 (file)
@@ -108,7 +108,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -172,7 +172,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
              return nloc_intregquad;
            }
       }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
index a927d46a05a3833d16dce4e4537be55b51e93f85..2043f9855c19319e0bbd9e3f0126a95924f0f137 100644 (file)
@@ -87,7 +87,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -127,7 +127,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
            return size <= asize ? nloc_intreg : nloc_intregpair;
          }
       }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
index d44f2601f21528f9336907e095d70256519d568f..33d7d964bd7b18887e35abbf5892e52ba5aa7aac 100644 (file)
@@ -84,7 +84,7 @@ sh_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
index e1b177538191ef2e8d7043987dc8c00f5232be32..fb81cdceaf34c59436fb5040d8aa81d58b0f9c0b 100644 (file)
@@ -91,7 +91,7 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
index db81a20b3a95782fefdef0d56b298aa856800828..7f7d24b046ac75918e4a2d04e4f1816c0a8d5847 100644 (file)
@@ -79,7 +79,7 @@ tilegx_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
@@ -113,7 +113,7 @@ tilegx_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          return nloc_intreg;
        }
 
-      /* Else fall through.  */
+      FALLTHROUGH;
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
     case DW_TAG_union_type:
index 843044071145968fb6a48ff0472e4b43f4a3124c..ef987daf43f01187c468d29e4d412ecafdcb2878 100644 (file)
@@ -87,7 +87,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
 
     case 6 ... 7:
       *type = DW_ATE_address;
-      /* Fallthrough */
+      FALLTHROUGH;
     case 0 ... 5:
       name[0] = 'r';
       name[1] = baseregs[regno][0];
index b3799ae075c5adef39fdb55cc1fcf71ddd0af418..f9114cb14858708d4e3fb1fed4887379f11aedf4 100644 (file)
@@ -100,7 +100,7 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
          typedie = dwarf_formref_die (attr, &die_mem);
          tag = DWARF_TAG_OR_RETURN (typedie);
        }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case DW_TAG_base_type:
     case DW_TAG_enumeration_type:
index ae40cc07d32ce732c0359e97f6f228cfe730c4a0..681def2fa579603e32e18e9ac446662f2712d0a2 100644 (file)
@@ -1,3 +1,7 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * eu.am (IMPLICIT_FALLTHROUGH_WARNING): Set to 5.
+
 2017-11-02  Mark Wielaard  <mark@klomp.org>
 
        * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir)
index 05c27f0262d3400bbbf1c782c55c0542215bdfb2..c2cc349ce87685727b05a759f365fb9e63a8f317 100644 (file)
@@ -62,7 +62,9 @@ NULL_DEREFERENCE_WARNING=
 endif
 
 if HAVE_IMPLICIT_FALLTHROUGH_WARNING
-IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
+# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the
+# warning
+IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5
 else
 IMPLICIT_FALLTHROUGH_WARNING=
 endif
index 4ab8816ad7f425ec917fafb25e61cd33582415a8..4cdb12af835f01f423647eb59acfe180f5ac4f27 100644 (file)
@@ -456,6 +456,12 @@ CFLAGS="$old_CFLAGS"])
 AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
               [test "x$ac_cv_implicit_fallthrough" != "xno"])
 
+# Assume the fallthrough attribute is supported if -Wimplict-fallthrough is supported
+if test "$ac_cv_implicit_fallthrough" = "yes"; then
+       AC_DEFINE([HAVE_FALLTHROUGH], [1],
+                 [Defined if __attribute__((fallthrough)) is supported])
+fi
+
 dnl Check if we have argp available from our libc
 AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
index 769c3dc97945fee5c7484b897f0ac234123509b8..0f03dab09cadd52bda75a90816133b4c591780a6 100644 (file)
@@ -1,3 +1,7 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * eu-config.h (FALLTHROUGH): New macro.
+
 2017-10-16  Mark Wielaard  <mark@klomp.org>
 
        * md5.{c,h}: Removed.
index 135803e7a536656ab2b6219340464e24036eecee..84b22d7c1f387ad1b6e861ccf2e9cd6ce146fc8d 100644 (file)
@@ -198,5 +198,12 @@ asm (".section predict_data, \"aw\"; .previous\n"
 # define COMPAT_VERSION(name, version, prefix) error "should use #ifdef SYMBOL_VERSIONING"
 #endif
 
+#ifndef FALLTHROUGH
+# ifdef HAVE_FALLTHROUGH
+#  define FALLTHROUGH __attribute__ ((fallthrough))
+# else
+#  define FALLTHROUGH ((void) 0)
+# endif
+#endif
 
 #endif /* eu-config.h */
index c710e5af7673490f24717f1eb5c56bf8b36b1e72..86d294782247abee851e2595a3ea3a8528ac6c64 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * i386_disasm.c (i386_disasm): Use FALLTHOUGH macro instead of
+       comment.
+
 2017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
 
        * memory-access.h: Use attribute_packed.
index 831afbe20166baf912aca2582f57748ac812bd2b..a7e03f95c4bb68af68e53fa4875d8ccf99b6159d 100644 (file)
@@ -819,7 +819,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
                              ++param_start;
                              break;
                            }
-                         /* Fallthrough */
+                         FALLTHROUGH;
                        default:
                          assert (! "INVALID not handled");
                        }
index cb5e61ac6529c249563789ce18d7f72760edc737..7a6d3110e6aa8f8aaed0bbc68ca078bc6c8b1b8e 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * cfi.c (execute_cfi): Use FALLTHROUGH macro instead of comment.
+       * dwarf_frame_register.c (dwarf_frame_register): Likewise.
+
 2018-01-22  Mark Wielaard  <mark@klomp.org>
 
        * Makefile.am (AM_CPPFLAGS): Add -I libdwelf.
index daa845f359d046527c118a2834188afa9aaadd4a..341e055b082f61833e188e6efaa4b1bb29ca85f7 100644 (file)
@@ -138,7 +138,7 @@ execute_cfi (Dwarf_CFI *cache,
 
        case DW_CFA_advance_loc1:
          operand = *program++;
-         /* Fallthrough */
+         FALLTHROUGH;
        case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
        advance_loc:
          loc += operand * cie->code_alignment_factor;
@@ -301,7 +301,7 @@ execute_cfi (Dwarf_CFI *cache,
 
        case DW_CFA_restore_extended:
          get_uleb128 (operand, program, end);
-         /* Fallthrough */
+         FALLTHROUGH;
        case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
 
          if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
index 37e8e9176d771db19ea287f691dfd98cc46ed5c1..d0159fb86b4d6c1aa9d8bd8e1e06f70862888acb 100644 (file)
@@ -62,7 +62,7 @@ dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
       /* Use the default rule for registers not yet mentioned in CFI.  */
       if (fs->cache->default_same_value)
        goto same_value;
-      /*FALLTHROUGH*/
+      FALLTHROUGH;
     case reg_undefined:
       /* The value is known to be unavailable.  */
       break;
index d487ec13930a4523b9b3abd43a8e17d40b54cbba..453f1d3e6ffdf3cc4d0002b25140a3728cf6ef16 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * dwfl_report_elf.c (__libdwfl_elf_address_range): Use FALLTHROUGH
+       macro instead of comment.
+       * frame_unwind.c (expr_eval): Likewise.
+
 2017-11-20  Mark Wielaard  <mark@klomp.org>
 
        * link_map.c (do_check64): Take a char * and calculate type and val
index 6950a37b4dc4d263833b5de6b374518c175720fd..3fc9384a4e22d4ea757c50f67174207598122076 100644 (file)
@@ -174,7 +174,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool add_p_vaddr,
       /* An assigned base address is meaningless for these.  */
       base = 0;
       add_p_vaddr = true;
-      /* Fallthrough. */
+      FALLTHROUGH;
     case ET_DYN:
     default:;
       size_t phnum;
index 4dc9c43252fd0a232168ede0cbc6712da94cfaef..eaea495f251aa29a42b789e8ac02e921850b2517 100644 (file)
@@ -442,7 +442,7 @@ expr_eval (Dwfl_Frame *state, Dwarf_Frame *frame, const Dwarf_Op *ops,
            }
          if (val1 == 0)
            break;
-         /* FALLTHRU */
+         FALLTHROUGH;
        case DW_OP_skip:;
          Dwarf_Word offset = op->offset + 1 + 2 + (int16_t) op->number;
          const Dwarf_Op *found = bsearch ((void *) (uintptr_t) offset, ops, nops,
index 3b0763321e6216b251cbcb2e6061c82ca35c977c..3ecd7328b3bbfccbb4c17005a00d0370c1e6d844 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * eblobjnote.c (ebl_object_note): Use FALLTHROUGH macro instead of
+       comment.
+
 2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
 
        * Makefile.am: Use fpic_CFLAGS.
index f80a1a5707617db5f442ae1b90a6d4b28e38683f..ca4f155d7821194a3fd33751a723b9e89d8962de 100644 (file)
@@ -223,7 +223,7 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
                free (buf);
              break;
            }
-         /* FALLTHROUGH */
+         FALLTHROUGH;
 
        default:
          /* Unknown type.  */
index 6aa1c6f55d2254a5e1327400c597a77ebd4d9660..55ab25ccf1998470e77dedd39493ebffe8b52023 100644 (file)
@@ -1,3 +1,11 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * elf32_updatenull.c (updatenull_wrlock): Use FALLTHROUGH macro
+       instead of comment.
+       * elf_begin.c (read_unmmaped_file): Likewise.
+       (elf_begin): Likewise.
+       * elf_cntl.c (elf_cntl): Likewise.
+
 2017-10-04  Mark Wielaard  <mark@klomp.org>
 
        * elf_begin.c (file_read_elf): Skip sanity checking e_shoff if scncnt
index d83c0b3f0c49edfa5a985e017901f6da715e7e5e..3e9ef61b4d08433b9888cc5fcfa1c56f02bf7f38 100644 (file)
@@ -232,7 +232,7 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
                      __libelf_seterrno (ELF_E_GROUP_NOT_REL);
                      return -1;
                    }
-                 /* FALLTHROUGH */
+                 FALLTHROUGH;
                case SHT_SYMTAB_SHNDX:
                  sh_entsize = elf_typesize (32, ELF_T_WORD, 1);
                  break;
index fb3a5b57f7c0346df243dfd9aac6b12a53ef9076..b20ab4f39338fe508ce7e8a2c2d57627ac61fdb0 100644 (file)
@@ -611,7 +611,7 @@ read_unmmaped_file (int fildes, off_t offset, size_t maxsize, Elf_Cmd cmd,
                             ? sizeof (Elf32_Ehdr) : sizeof (Elf64_Ehdr)))
        return file_read_elf (fildes, NULL, mem.header, offset, maxsize, cmd,
                              parent);
-      /* FALLTHROUGH */
+      FALLTHROUGH;
 
     default:
       break;
@@ -1126,7 +1126,7 @@ elf_begin (int fildes, Elf_Cmd cmd, Elf *ref)
          retval = NULL;
          break;
        }
-      /* FALLTHROUGH */
+      FALLTHROUGH;
 
     case ELF_C_READ:
     case ELF_C_READ_MMAP:
index ab13ffb6da91df27cc4fb5a0df05bafe9c11b992..fd681789ff5f818f4c8a8fee29e042f8ecdf1427 100644 (file)
@@ -62,7 +62,7 @@ elf_cntl (Elf *elf, Elf_Cmd cmd)
          result = -1;
          break;
        }
-      /* FALLTHROUGH */
+      FALLTHROUGH;
 
     case ELF_C_FDDONE:
       /* Mark the file descriptor as not usable.  */
index a0bb7a25736d448179ecee1b46ea6e02b6898c8a..a490705fd79998ab239d3ab992c81507d3e4792d 100644 (file)
@@ -1,3 +1,18 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * addr2line.c (handle_address): Use FALLTHROUGH macro instead of
+       comment.
+       * elfcompress.c (parse_opt): Likewise.
+       * elflint.c (check_dynamic): Likewise.
+       (check_sections): Likewise.
+       (check_note_data): Likewise.
+       * objdump.c (parse_opt): Likewise.
+       * readelf.c (parse_opt): Likewise.
+       (attr_callback): Likewise.
+       (handle_auxv_note): Likewise.
+       * strings.c (parse_opt): Likewise.
+       * backtrace.c (callback_verify): Likewise.
+
 2018-01-25  Mark Wielaard  <mark@klomp.org>
 
        * readelf.c (print_debug_ranges_section): Initialize cu to last_cu.
index ba414a74d424fdbd48095a31af1f73e2fdcadd9b..444ee52ca03943d9f5797bca7fd0a5270e4fac80 100644 (file)
@@ -618,7 +618,7 @@ handle_address (const char *string, Dwfl *dwfl)
        case 1:
          addr = 0;
          j = i;
-         /* Fallthrough */
+         FALLTHROUGH;
        case 2:
          if (string[j] != '\0')
            break;
index 8e0d5c559c5a9012c82e81adfe0659d8cc71fe70..25378a455896d0b70d0e74a3dcf675bb3b5c46e6 100644 (file)
@@ -149,7 +149,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
                    N_("Only one input file allowed together with '-o'"));
       /* We only use this for checking the number of arguments, we don't
         actually want to consume them.  */
-      /* Fallthrough */
+      FALLTHROUGH;
     default:
       return ARGP_ERR_UNKNOWN;
     }
index 51e53c23c5eeef318c9d87066dd87371d963540d..df1b3a03274fa8a5a0e2fbe6af07ab30646bd9f1 100644 (file)
@@ -1764,7 +1764,7 @@ section [%2d] '%s': entry %zu: pointer does not match address of section [%2d] '
          if (dyn->d_tag < DT_ADDRRNGLO || dyn->d_tag > DT_ADDRRNGHI)
            /* Value is no pointer.  */
            break;
-         /* FALLTHROUGH */
+         FALLTHROUGH;
 
        case DT_AUXILIARY:
        case DT_FILTER:
@@ -3993,7 +3993,7 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"),
            case SHT_NOBITS:
              if (is_debuginfo)
                break;
-             /* Fallthrough */
+             FALLTHROUGH;
            default:
              ERROR (gettext ("\
 section [%2zu] '%s' has unexpected type %d for an executable section\n"),
@@ -4137,7 +4137,7 @@ section [%2zu] '%s': ELF header says this is the section header string table but
            ERROR (gettext ("\
 section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"),
                   cnt, section_name (ebl, cnt));
-         /* FALLTHROUGH */
+         FALLTHROUGH;
        case SHT_SYMTAB:
          check_symtab (ebl, ehdr, shdr, cnt);
          break;
@@ -4336,7 +4336,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32
            if (nhdr.n_namesz == sizeof "Linux"
                && !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
              break;
-           /* Fallthrough */
+           FALLTHROUGH;
          default:
            if (shndx == 0)
              ERROR (gettext ("\
index 860cfac6923d6f63b52d875b667e6e1689603e1f..0dd9a6aa0662e235e8e41d03ecf76d02eb41ea6c 100644 (file)
@@ -223,7 +223,7 @@ parse_opt (int key, char *arg,
        }
       /* We only use this for checking the number of arguments, we don't
         actually want to consume them.  */
-      /* Fallthrough */
+      FALLTHROUGH;
     default:
       return ARGP_ERR_UNKNOWN;
     }
index 6c49d305a017729927628443edd8ea6259aea9dd..d606cf5a1dabc3069d0bd4b5b9ccb81b31398540 100644 (file)
@@ -480,7 +480,7 @@ parse_opt (int key, char *arg,
          print_string_sections = true;
          break;
        }
-      /* Fall through.  */
+      FALLTHROUGH;
     case 'x':
       add_dump_section (arg, false);
       any_control_option = true;
@@ -6081,7 +6081,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
                        dwarf_form_name (form), (uintmax_t) num);
              return DWARF_CB_OK;
            }
-         /* else fallthrough */
+         FALLTHROUGH;
 
        /* These cases always take a loclistptr and no constant. */
        case DW_AT_location:
@@ -6269,7 +6269,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
              print_block (block.length, block.data);
              break;
            }
-         /* Fall through.  */
+         FALLTHROUGH;
 
        case DW_AT_location:
        case DW_AT_data_location:
@@ -9326,7 +9326,7 @@ handle_auxv_note (Ebl *ebl, Elf *core, GElf_Word descsz, GElf_Off desc_pos)
                printf ("    %s\n", name);
                break;
              }
-           /* Fall through */
+           FALLTHROUGH;
          case 'x':             /* hex */
          case 'p':             /* address */
          case 's':             /* address of string */
index d214356c39cdd4cd18c38fef35a340b74dda07c9..03d0f1338374743af650094691ba92da10a52ccb 100644 (file)
@@ -246,7 +246,7 @@ parse_opt (int key, char *arg,
        case 'b':
        case 'B':
          big_endian = true;
-         /* FALLTHROUGH */
+         FALLTHROUGH;
 
        case 'l':
        case 'L':
index 89c531b422b3ac79f33d979d7163dbe8d256cde2..5ee8626ed62126cf0d68525b7851e42dfe612044 100644 (file)
@@ -1,3 +1,7 @@
+2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
+
+       * elfstrmerge.c (main): Use FALLTHROUGH macro instead of comment.
+
 2018-01-22  Mark Wielaard  <mark@klomp.org>
 
        * allfcts.c (setup_alt): Print warning when alt file couldn't be
index 21abe8af1cc33dbc28daa05d7eef01f9b45641fb..f5dd761f38d59ca9346b41a0fdfb2c0a736c31d2 100644 (file)
@@ -127,7 +127,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
          assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
          break;
        }
-      /* FALLTHRU */
+      FALLTHROUGH;
     case 4:
       /* Some simple frame unwinders get this wrong and think sigusr2
         is calling itself again. Allow it and just pretend there is
index 6924d0e92f71cdc3a51ee2a3e48ae19ad09e2dca..3bb90c42f809f1057ba329b154151bd9c7af51e8 100644 (file)
@@ -578,7 +578,8 @@ main (int argc, char **argv)
              break;
 
            case SHT_DYNAMIC:
-             /* Fallthrough.  There are string indexes in here, but
+             FALLTHROUGH;
+             /* There are string indexes in here, but
                 they (should) point to a allocated string table,
                 which we don't alter.  */
            default: