bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157)

diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 010658e..0bcfc13 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -3616,7 +3616,7 @@
         case (PARAMFLAG_FIN | PARAMFLAG_FOUT):
             *pinoutmask |= (1 << i); /* mark as inout arg */
             (*pnumretvals)++;
-            /* fall through to PARAMFLAG_FIN... */
+            /* fall through */
         case 0:
         case PARAMFLAG_FIN:
             /* 'in' parameter.  Copy it from inargs. */
diff --git a/Objects/call.c b/Objects/call.c
index 3b08cb2..4294a9b 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -499,7 +499,7 @@
         if (kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) {
             goto no_keyword_error;
         }
-        /* fall through next case */
+        /* fall through */
 
     case METH_VARARGS | METH_KEYWORDS:
     {
@@ -656,7 +656,7 @@
         if (nkwargs) {
             goto no_keyword_error;
         }
-        /* fall through next case */
+        /* fall through */
 
     case METH_VARARGS | METH_KEYWORDS:
     {
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index 43f2f32..f019d9a 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -330,7 +330,7 @@
             case _Py_ERROR_REPLACE:
                 memset(p, '?', endpos - startpos);
                 p += (endpos - startpos);
-                /* fall through the ignore handler */
+                /* fall through */
             case _Py_ERROR_IGNORE:
                 i += (endpos - startpos - 1);
                 break;
@@ -378,7 +378,7 @@
                 }
                 startpos = k;
                 assert(startpos < endpos);
-                /* fall through the default handler */
+                /* fall through */
             default:
                 rep = unicode_encode_call_errorhandler(
                       errors, &error_handler_obj, "utf-8", "surrogates not allowed",
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 0e6cb7f..f7b2aa6 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1794,6 +1794,7 @@
 
     case SSTATE_INTERNED_IMMORTAL:
         Py_FatalError("Immortal interned string died.");
+        /* fall through */
 
     default:
         Py_FatalError("Inconsistent interned string state.");
@@ -6778,7 +6779,7 @@
             case _Py_ERROR_REPLACE:
                 memset(str, '?', collend - collstart);
                 str += (collend - collstart);
-                /* fall through ignore error handler */
+                /* fall through */
             case _Py_ERROR_IGNORE:
                 pos = collend;
                 break;
@@ -6817,7 +6818,7 @@
                     break;
                 collstart = pos;
                 assert(collstart != collend);
-                /* fallback to general error handling */
+                /* fall through */
 
             default:
                 rep = unicode_encode_call_errorhandler(errors, &error_handler_obj,
diff --git a/Python/ast.c b/Python/ast.c
index becf0ad..89206c3 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1182,6 +1182,7 @@
                     return In;
                 if (strcmp(STR(n), "is") == 0)
                     return Is;
+                /* fall through */
             default:
                 PyErr_Format(PyExc_SystemError, "invalid comp_op: %s",
                              STR(n));
@@ -1196,6 +1197,7 @@
                     return NotIn;
                 if (strcmp(STR(CHILD(n, 0)), "is") == 0)
                     return IsNot;
+                /* fall through */
             default:
                 PyErr_Format(PyExc_SystemError, "invalid comp_op: %s %s",
                              STR(CHILD(n, 0)), STR(CHILD(n, 1)));
@@ -3147,6 +3149,7 @@
                 }
                 return Raise(expression, cause, LINENO(n), n->n_col_offset, c->c_arena);
             }
+            /* fall through */
         default:
             PyErr_Format(PyExc_SystemError,
                          "unexpected flow_stmt: %d", TYPE(ch));
diff --git a/Python/ceval.c b/Python/ceval.c
index 9f732f5..92b1331 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1807,9 +1807,11 @@
             switch (oparg) {
             case 2:
                 cause = POP(); /* cause */
+                /* fall through */
             case 1:
                 exc = POP(); /* exc */
-            case 0: /* Fallthrough */
+                /* fall through */
+            case 0:
                 if (do_raise(exc, cause)) {
                     why = WHY_EXCEPTION;
                     goto fast_block_end;
diff --git a/Python/compile.c b/Python/compile.c
index 280ddc3..78e797a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4154,6 +4154,7 @@
         else if (o == Py_False)
             return 0;
     }
+    /* fall through */
     default:
         return -1;
     }
@@ -4446,13 +4447,13 @@
         switch (e->v.Attribute.ctx) {
         case AugLoad:
             ADDOP(c, DUP_TOP);
-            /* Fall through to load */
+            /* Fall through */
         case Load:
             ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names);
             break;
         case AugStore:
             ADDOP(c, ROT_TWO);
-            /* Fall through to save */
+            /* Fall through */
         case Store:
             ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names);
             break;
diff --git a/Python/dtoa.c b/Python/dtoa.c
index efcadc3..01ca9b0 100644
--- a/Python/dtoa.c
+++ b/Python/dtoa.c
@@ -1454,7 +1454,7 @@
     switch (c) {
     case '-':
         sign = 1;
-        /* no break */
+        /* fall through */
     case '+':
         c = *++s;
     }
@@ -1523,7 +1523,7 @@
         switch (c) {
         case '-':
             esign = 1;
-            /* no break */
+            /* fall through */
         case '+':
             c = *++s;
         }
@@ -2441,7 +2441,7 @@
         break;
     case 2:
         leftright = 0;
-        /* no break */
+        /* fall through */
     case 4:
         if (ndigits <= 0)
             ndigits = 1;
@@ -2449,7 +2449,7 @@
         break;
     case 3:
         leftright = 0;
-        /* no break */
+        /* fall through */
     case 5:
         i = ndigits + k + 1;
         ilim = i;
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index a2c2b36..9192bfd 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -312,6 +312,7 @@
                 format->thousands_separators = LT_UNDER_FOUR_LOCALE;
                 break;
             }
+            /* fall through */
         default:
             invalid_comma_type(format->type);
             return 0;
diff --git a/Python/getargs.c b/Python/getargs.c
index 471f729..4645b0f 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -2304,8 +2304,8 @@
                 /* after 'e', only 's' and 't' is allowed */
                 goto err;
             format++;
-            /* explicit fallthrough to string cases */
         }
+        /* fall through */
 
     case 's': /* string */
     case 'z': /* string or None */
diff --git a/Python/marshal.c b/Python/marshal.c
index b2c00a0..b6337e1 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1112,6 +1112,7 @@
 
     case TYPE_ASCII_INTERNED:
         is_interned = 1;
+        /* fall through */
     case TYPE_ASCII:
         n = r_long(p);
         if (PyErr_Occurred())
@@ -1124,6 +1125,7 @@
 
     case TYPE_SHORT_ASCII_INTERNED:
         is_interned = 1;
+        /* fall through */
     case TYPE_SHORT_ASCII:
         n = r_byte(p);
         if (n == EOF) {
@@ -1149,6 +1151,7 @@
 
     case TYPE_INTERNED:
         is_interned = 1;
+        /* fall through */
     case TYPE_UNICODE:
         {
         const char *buffer;
diff --git a/Python/pyhash.c b/Python/pyhash.c
index 57a2da7..a2ec230 100644
--- a/Python/pyhash.c
+++ b/Python/pyhash.c
@@ -393,13 +393,13 @@
     pt = (uint8_t *)&t;
     m = (uint8_t *)in;
     switch (src_sz) {
-        case 7: pt[6] = m[6];
-        case 6: pt[5] = m[5];
-        case 5: pt[4] = m[4];
+        case 7: pt[6] = m[6]; /* fall through */
+        case 6: pt[5] = m[5]; /* fall through */
+        case 5: pt[4] = m[4]; /* fall through */
         case 4: memcpy(pt, m, sizeof(uint32_t)); break;
-        case 3: pt[2] = m[2];
-        case 2: pt[1] = m[1];
-        case 1: pt[0] = m[0];
+        case 3: pt[2] = m[2]; /* fall through */
+        case 2: pt[1] = m[1]; /* fall through */
+        case 1: pt[0] = m[0]; /* fall through */
     }
     b |= _le64toh(t);
 
diff --git a/Python/wordcode_helpers.h b/Python/wordcode_helpers.h
index b0e3a91..cce81c1 100644
--- a/Python/wordcode_helpers.h
+++ b/Python/wordcode_helpers.h
@@ -28,10 +28,13 @@
     switch (ilen) {
         case 4:
             *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 24) & 0xff);
+            /* fall through */
         case 3:
             *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 16) & 0xff);
+            /* fall through */
         case 2:
             *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 8) & 0xff);
+            /* fall through */
         case 1:
             *codestr++ = PACKOPARG(opcode, oparg & 0xff);
             break;