From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] tests: Add break to avoid implicit-fallthrough warning
Date: Fri, 06 Dec 2019 14:42:00 -0000 [thread overview]
Message-ID: <20191206144149.3696-1-mark@klomp.org> (raw)
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
next reply other threads:[~2019-12-06 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 14:42 Mark Wielaard [this message]
2019-12-06 16:21 ` Florian Weimer
2019-12-06 21:26 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191206144149.3696-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).