-2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * configure.ac: Add check for whether gcc accepts
+ -Wimplict-fallthrough.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
* configure.ac: Add memrchr, rawmemchr and powerof2 checks.
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * i386_regs.c (i386_register_info): Add fallthrough comment.
+ * i386_retval.c (i386_return_value_location): Move fallthrough
+ comment.
+ * linux-core-note.c (core_note): Adjust fallthrough comment.
+ * m68k_retval.c (m68k_return_value_location): Move fallthrough
+ comment.
+ * ppc_regs.c (ppc_register_info): Add fallthrough comment.
+ * x86_64_regs.c (x86_64_register_info): Likewise.
+
2016-08-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc_attrs.c (sparc_check_object_attribute): Fix the
case 5:
case 8:
*type = DW_ATE_address;
+ /* Fallthrough */
case 0 ... 3:
case 6 ... 7:
name[0] = 'e';
return nloc_intreg;
if (size <= 8)
return nloc_intregpair;
-
- /* Else fall through. */
}
+ /* Fallthrough */
case DW_TAG_structure_type:
case DW_TAG_class_type:
case sizeof "CORE":
if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
break;
- /* Buggy old Linux kernels didn't terminate "LINUX".
- Fall through. */
+ /* Buggy old Linux kernels didn't terminate "LINUX". */
+ /* Fall through. */
case sizeof "LINUX":
if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
return nloc_intreg;
if (size <= 8)
return nloc_intregpair;
-
- /* Else fall through. */
}
-
+ /* Fallthrough */
case DW_TAG_structure_type:
case DW_TAG_class_type:
case DW_TAG_union_type:
case 100:
if (*bits == 32)
return stpcpy (name, "mq") + 1 - name;
-
+ /* Fallthrough */
case 102 ... 107:
name[0] = 's';
name[1] = 'p';
case 6 ... 7:
*type = DW_ATE_address;
+ /* Fallthrough */
case 0 ... 5:
name[0] = 'r';
name[1] = baseregs[regno][0];
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * eu.am: Check HAVE_IMPLICIT_FALLTHROUGH_WARNING.
+ (AM_CFLAGS): Add IMPLICIT_FALLTHROUGH_WARNING.
+
2016-08-04 Mark Wielaard <mjw@redhat.com>
* elfutils.spec.in: Update for 0.167.
NULL_DEREFERENCE_WARNING=
endif
+if HAVE_IMPLICIT_FALLTHROUGH_WARNING
+IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
+else
+IMPLICIT_FALLTHROUGH_WARNING=
+endif
+
AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
- $(NULL_DEREFERENCE_WARNING) \
+ $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING,
[test "x$ac_cv_null_dereference" != "xno"])
+# -Wimplicit-fallthrough was added by GCC7
+AC_CACHE_CHECK([whether gcc accepts -Wimplicit-fallthrough], ac_cv_implicit_fallthrough, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_implicit_fallthrough=yes, ac_cv_implicit_fallthrough=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
+ [test "x$ac_cv_implicit_fallthrough" != "xno"])
+
dnl Check if we have argp available from our libc
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
-2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * i386_disasm.c (i386_disasm): Add fallthrough comment.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
* i386_lex.l: Remove system.h include, add libeu.h include.
* i386_parse.y: Remove sys/param.h include, add libeu.h include.
++param_start;
break;
}
-
+ /* Fallthrough */
default:
assert (! "INVALID not handled");
}
-2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * cfi.c (execute_cfi): Add fallthrough comments.
+ * encoded-value.h (encoded_value_size): Add explicit return instead
+ of relying on fallthrough.
+ * dwfl_report_elf.c (__libdwfl_elf_address_range): Add fallthrough
+ comment.
+
+2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
* dwarf_getpubnames.c: Remove sys/param.h include, add system.h.
* libdw_alloc.c: Likewise.
case DW_CFA_advance_loc1:
operand = *program++;
+ /* Fallthrough */
case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
advance_loc:
loc += operand * cie->code_alignment_factor;
case DW_CFA_restore_extended:
get_uleb128 (operand, program, end);
+ /* Fallthrough */
case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
if (*end++ & 0x80u)
return end - p;
}
+ return 0;
default:
return 0;
/* An assigned base address is meaningless for these. */
base = 0;
add_p_vaddr = true;
-
+ /* Fallthrough. */
case ET_DYN:
default:;
size_t phnum;
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * addr2line.c (handle_address): Add fallthrough comment.
+ * elfcompress.c (parse_opt): Adjust fallthrough comment.
+ * elflint.c (parse_opt): Add missing break after 'd' case.
+ (check_sections): Add fallthrough comments.
+ * objdump.c (parse_opt): Add explantion for fallthrough comment.
+
2016-10-22 Kevin Cernekee <cernekee@chromium.org>
* unstrip.c: Fix "invalid string offset" error caused by using the
case 1:
addr = 0;
j = i;
+ /* Fallthrough */
case 2:
if (string[j] != '\0')
break;
argp_error (state,
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, so fallthrough. */
+ actually want to consume them. */
+ /* Fallthrough */
default:
return ARGP_ERR_UNKNOWN;
}
case 'd':
is_debuginfo = true;
+ break;
case ARGP_gnuld:
gnuld = true;
case SHT_NOBITS:
if (is_debuginfo)
break;
+ /* Fallthrough */
default:
ERROR (gettext ("\
section [%2zu] '%s' has unexpected type %d for an executable section\n"),
if (nhdr.n_namesz == sizeof "Linux"
&& !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
break;
-
+ /* Fallthrough */
default:
if (shndx == 0)
ERROR (gettext ("\
program_invocation_short_name);
exit (EXIT_FAILURE);
}
-
+ /* We only use this for checking the number of arguments, we don't
+ actually want to consume them. */
+ /* Fallthrough */
default:
return ARGP_ERR_UNKNOWN;
}
+2016-11-02 Mark Wielaard <mjw@redhat.com>
+
+ * backtrace-data.c (thread_callback): Add explicit break after error.
+ * backtrace.c (callback_verify): Change PASSTHRU to FALLTHRU.
+
2016-10-22 Kevin Cernekee <cernekee@chromium.org>
* Makefile.am (TESTS): Add run-unstrip-test4.sh.
break;
case -1:
error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1));
+ break;
default:
abort ();
}
assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
break;
}
- /* PASSTHRU */
+ /* FALLTHRU */
case 4:
assert (symname != NULL && strcmp (symname, "stdarg") == 0);
break;