diff options
author | Mark Wielaard <mjw@redhat.com> | 2016-11-02 13:29:26 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2016-11-10 11:59:00 +0100 |
commit | a3cc8182b2ae05290b0eafa74b70746d7befc0e4 (patch) | |
tree | 7d1f74f9f464b810a95dc7cd78c73930a938924a /tests | |
parent | 33ca0e1b9dfb47c6f9836c7fc19d04bd34337767 (diff) | |
download | elfutils-a3cc8182b2ae05290b0eafa74b70746d7befc0e4.tar.gz |
Add GCC7 -Wimplicit-fallthrough support/fixes.
GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one
small buglet in elflint option procession. So it seems useful to enable
to make sure all swatch case fallthroughs are deliberate.
Add configure check to detect whether gcc support -Wimplicit-fallthrough
and enable it. Add fixes and explicit fallthrough comments where necessary.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 5 | ||||
-rw-r--r-- | tests/backtrace-data.c | 1 | ||||
-rw-r--r-- | tests/backtrace.c | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 3d34778b..5a9d5372 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c index bc5ceba0..b7158dae 100644 --- a/tests/backtrace-data.c +++ b/tests/backtrace-data.c @@ -250,6 +250,7 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg __attribute__ ((unused))) break; case -1: error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1)); + break; default: abort (); } diff --git a/tests/backtrace.c b/tests/backtrace.c index 2440ab34..1ff6353c 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -123,7 +123,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc, assert (symname2 == NULL || strcmp (symname2, "jmp") != 0); break; } - /* PASSTHRU */ + /* FALLTHRU */ case 4: assert (symname != NULL && strcmp (symname, "stdarg") == 0); break; |