public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] tests: Add break to avoid implicit-fallthrough warning
@ 2019-12-06 14:42 Mark Wielaard
  2019-12-06 16:21 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2019-12-06 14:42 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

For some reason gcc might fail to recognize the assert (0) will never
return and emit an implicit-fallthrough warning. Just add a break to
silence it.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/ChangeLog        | 4 ++++
 tests/backtrace-data.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 70100de4..fb881e76 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-06  Mark Wielaard  <mark@klomp.org>
+
+	* backtrace-data.c (main): Add break after assert.
+
 2019-12-05  Mark Wielaard  <mark@klomp.org>
 
 	* run-elfclassify.sh: Run elfcompress under testrun.
diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
index 907b4780..c81880d9 100644
--- a/tests/backtrace-data.c
+++ b/tests/backtrace-data.c
@@ -280,6 +280,7 @@ main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
   {
     case -1:
       assert (0);
+      break;
     case 0:;
       long l = ptrace (PTRACE_TRACEME, 0, NULL, NULL);
       assert (l == 0);
-- 
2.20.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-06 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 14:42 [PATCH] tests: Add break to avoid implicit-fallthrough warning Mark Wielaard
2019-12-06 16:21 ` Florian Weimer
2019-12-06 21:26   ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).