>From b0cda9f0926baf723858809dfbf7899fdd54b111 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 8 Sep 2017 08:26:01 +0200 Subject: [PATCH] Fix some GCC warnings * configure.ac: Use -Wimplicit-fallthrough=1. * lib/wordsplit.c (wordsplit_perror): Fix missing break. * src/sparse.c (sparse_scan_file): Explicitly mention fallback. --- configure.ac | 1 + lib/wordsplit.c | 1 + src/sparse.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e89ed1d..fac44fa 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,7 @@ if test "$gl_gcc_warnings" = yes; then gl_WARN_ADD([-fdiagnostics-show-option]) gl_WARN_ADD([-funit-at-a-time]) + gl_WARN_ADD([-Wimplicit-fallthrough=1]) # Be more tolerant to fall-through comments AC_SUBST([WARN_CFLAGS]) diff --git a/lib/wordsplit.c b/lib/wordsplit.c index 07d0f8a..f2ecada 100644 --- a/lib/wordsplit.c +++ b/lib/wordsplit.c @@ -1584,6 +1584,7 @@ wordsplit_perror (struct wordsplit *wsp) case WRDSE_NOSUPP: wsp->ws_error (_("command substitution is not yet supported")); + break; case WRDSE_USAGE: wsp->ws_error (_("invalid wordsplit usage")); diff --git a/src/sparse.c b/src/sparse.c index b3a3fd3..5bd2b01 100644 --- a/src/sparse.c +++ b/src/sparse.c @@ -361,6 +361,7 @@ sparse_scan_file (struct tar_sparse_file *file) /* fall back to "raw" for this and all other files */ hole_detection = HOLE_DETECTION_RAW; #endif + /* fallthrough */ case HOLE_DETECTION_RAW: if (sparse_scan_file_raw (file)) return true; -- 2.13.5