]> Savannah Git Hosting - gnulib.git/commitdiff
long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
authorJim Meyering <meyering@fb.com>
Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)
committerJim Meyering <meyering@fb.com>
Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)
* 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
lib/long-options.c

index 7b0417702844297b5abfed037fa0c40504a1a3a5..ebf9a35d3c4805485407243f4a4835621a7f38c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2016-10-05  Jim Meyering  <meyering@fb.com>
 
+       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 \
index e694e280d206a196543569369b2acdc454984138..ff28e0fd6408f240d6ad08698d13aa9344d49a96 100644 (file)
@@ -64,6 +64,7 @@ parse_long_options (int argc,
         {
         case 'h':
           (*usage_func) (EXIT_SUCCESS);
+          break;
 
         case 'v':
           {