From d392d4925dd6649ad11b5885a0602d14069f685c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 5 Oct 2016 10:43:09 -0700 Subject: [PATCH] long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/long-options.c (parse_long_options): Add a break statement to avoid this new warning/failure: $ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \ --create-testdir --dir=/t/x --with-tests --test long-options ../../gllib/long-options.c: In function ‘parse_long_options’: ../../gllib/long-options.c:66:12: error: this statement may \ fall through [-Werror=implicit-fallthrough] (*usage_func) (EXIT_SUCCESS); ~^~~~~~~~~~~~~~~~~~~~~~~~~~~ --- ChangeLog | 11 +++++++++++ lib/long-options.c | 1 + 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7b04177..ebf9a35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2016-10-05 Jim Meyering + long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough + * lib/long-options.c (parse_long_options): Add a break statement + to avoid this new warning/failure: + $ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \ + --create-testdir --dir=/t/x --with-tests --test long-options + ../../gllib/long-options.c: In function ‘parse_long_options’: + ../../gllib/long-options.c:66:12: error: this statement may \ + fall through [-Werror=implicit-fallthrough] + (*usage_func) (EXIT_SUCCESS); + ~^~~~~~~~~~~~~~~~~~~~~~~~~~~ + utimecmp: avoid new GCC 7 warning from -Wbool-operation Testing this module would fail when using GCC 7 like this: $ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \ diff --git a/lib/long-options.c b/lib/long-options.c index e694e28..ff28e0f 100644 --- a/lib/long-options.c +++ b/lib/long-options.c @@ -64,6 +64,7 @@ parse_long_options (int argc, { case 'h': (*usage_func) (EXIT_SUCCESS); + break; case 'v': { -- 2.7.4