tests: Add break to avoid implicit-fallthrough warning
authorMark Wielaard <mark@klomp.org>
Fri, 6 Dec 2019 14:39:38 +0000 (15:39 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 10 Dec 2019 23:33:19 +0000 (00:33 +0100)
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
tests/backtrace-data.c

index 70100de..fb881e7 100644 (file)
@@ -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.
index 907b478..c81880d 100644 (file)
@@ -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);