[dpkg] 193/200: dpkg: Add a comment on any switch case that falls through

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit 63bf76937536f21b5ec110c75c166c3d7b343c76
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Feb 22 22:44:29 2017 +0100

    dpkg: Add a comment on any switch case that falls through
    
    Warned-by: gcc-7
---
 debian/changelog | 2 ++
 src/archives.c   | 1 +
 src/depcon.c     | 6 ++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ec7f51f..60ee615 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ dpkg (1.18.23) UNRELEASED; urgency=medium
     the same “__cxxabiv1” namespace as specified in the C++ ABI, instead
     of using the “abi” alias intended for use by userland.
     Thanks to Jörg Sonnenberger <joerg at netbsd.org>.
+  * Add a comment on any C code switch case that falls through. Fixes new
+    gcc-7 warnings.
   * Portability:
     - Do not redeclare sys_siglist in libcompat when the system does so.
       Thanks to Thomas Klausner <wiz at NetBSD.org>.
diff --git a/src/archives.c b/src/archives.c
index 840dd29..d91a075 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -851,6 +851,7 @@ tarobject(void *ctx, struct tar_entry *ti)
       switch (otherpkg->clientdata->replacingfilesandsaid) {
       case 2:
         keepexisting = true;
+        /* Fall through. */
       case 1:
         continue;
       }
diff --git a/src/depcon.c b/src/depcon.c
index 2515f3a..924c53a 100644
--- a/src/depcon.c
+++ b/src/depcon.c
@@ -420,8 +420,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
           case PKG_STAT_TRIGGERSAWAITED:
               if (canfixbytrigaw && versionsatisfied(&pkg_pos->installed, possi))
                 *canfixbytrigaw = pkg_pos;
-              /* Fall through to have a chance to return OK due to
-               * allowunconfigd and to fill the explanation */
+              /* Fall through. */
           case PKG_STAT_UNPACKED:
           case PKG_STAT_HALFCONFIGURED:
             if (allowunconfigd) {
@@ -581,6 +580,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
           case PKG_STAT_HALFCONFIGURED:
             if (dep->type == dep_breaks)
               break; /* No problem. */
+            /* Fall through. */
           case PKG_STAT_INSTALLED:
           case PKG_STAT_TRIGGERSPENDING:
           case PKG_STAT_TRIGGERSAWAITED:
@@ -651,6 +651,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
         case PKG_ISTOBE_DECONFIGURE:
           if (dep->type == dep_breaks)
             continue; /* Already deconfiguring. */
+          /* Fall through. */
         case PKG_ISTOBE_NORMAL:
         case PKG_ISTOBE_PREINSTALL:
           switch (provider->up->up->status) {
@@ -662,6 +663,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
           case PKG_STAT_HALFCONFIGURED:
             if (dep->type == dep_breaks)
               break; /* No problem. */
+            /* Fall through. */
           case PKG_STAT_INSTALLED:
           case PKG_STAT_TRIGGERSPENDING:
           case PKG_STAT_TRIGGERSAWAITED:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list