get rid of "implicit fallthrough" warnings with gcc 7
authorLukas Mai <l.mai@web.de>
Fri, 13 Oct 2017 17:50:24 +0000 (19:50 +0200)
committerLukas Mai <l.mai@web.de>
Fri, 13 Oct 2017 17:50:24 +0000 (19:50 +0200)
gv.c
mg.c
op.c
perlio.c
pp_ctl.c
sbox32_hash.h
sv.c
toke.c
vxs.inc

diff --git a/gv.c b/gv.c
index 5d96332..b3b9f7f 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -3537,7 +3537,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
             res = &PL_sv_undef;
             SP = PL_stack_base + oldmark;
             break;
-        case G_ARRAY: {
+        case G_ARRAY:
             if (flags & AMGf_want_list) {
                 res = sv_2mortal((SV *)newAV());
                 av_extend((AV *)res, nret);
@@ -3546,7 +3546,6 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
                 break;
             }
             /* FALLTHROUGH */
-        }
         default:
             res = POPs;
             break;
diff --git a/mg.c b/mg.c
index fe4f8a5..8c0c1b5 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -994,6 +994,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
        break;
 #endif  /* End of platforms with special handling for $^E; others just fall
            through to $! */
+    /* FALLTHROUGH */
 
     case '!':
        {
diff --git a/op.c b/op.c
index ebfa04d..4e45800 100644 (file)
--- a/op.c
+++ b/op.c
@@ -957,6 +957,7 @@ Perl_op_clear(pTHX_ OP *o)
        SvREFCNT_dec(cMETHOPx(o)->op_rclass_sv);
        cMETHOPx(o)->op_rclass_sv = NULL;
 #endif
+        /* FALLTHROUGH */
     case OP_METHOD_NAMED:
     case OP_METHOD_SUPER:
         SvREFCNT_dec(cMETHOPx(o)->op_u.op_meth_sv);
@@ -1080,12 +1081,14 @@ Perl_op_clear(pTHX_ OP *o)
 
                 case MDEREF_HV_padhv_helem:
                     is_hash = TRUE;
+                    /* FALLTHROUGH */
                 case MDEREF_AV_padav_aelem:
                     pad_free((++items)->pad_offset);
                     goto do_elem;
 
                 case MDEREF_HV_gvhv_helem:
                     is_hash = TRUE;
+                    /* FALLTHROUGH */
                 case MDEREF_AV_gvav_aelem:
 #ifdef USE_ITHREADS
                     S_op_clear_gv(aTHX_ o, &((++items)->pad_offset));
@@ -1096,6 +1099,7 @@ Perl_op_clear(pTHX_ OP *o)
 
                 case MDEREF_HV_gvsv_vivify_rv2hv_helem:
                     is_hash = TRUE;
+                    /* FALLTHROUGH */
                 case MDEREF_AV_gvsv_vivify_rv2av_aelem:
 #ifdef USE_ITHREADS
                     S_op_clear_gv(aTHX_ o, &((++items)->pad_offset));
@@ -1106,6 +1110,7 @@ Perl_op_clear(pTHX_ OP *o)
 
                 case MDEREF_HV_padsv_vivify_rv2hv_helem:
                     is_hash = TRUE;
+                    /* FALLTHROUGH */
                 case MDEREF_AV_padsv_vivify_rv2av_aelem:
                     pad_free((++items)->pad_offset);
                     goto do_vivify_rv2xv_elem;
@@ -1113,6 +1118,7 @@ Perl_op_clear(pTHX_ OP *o)
                 case MDEREF_HV_pop_rv2hv_helem:
                 case MDEREF_HV_vivify_rv2hv_helem:
                     is_hash = TRUE;
+                    /* FALLTHROUGH */
                 do_vivify_rv2xv_elem:
                 case MDEREF_AV_pop_rv2av_aelem:
                 case MDEREF_AV_vivify_rv2av_aelem:
index 209af1b..122cfcc 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -934,9 +934,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names)
                            if (*e++) {
                                break;
                            }
-                           /*
-                            * Drop through
-                            */
+                            /* Fall through */
                        case '\0':
                            e--;
                            Perl_ck_warner(aTHX_ packWARN(WARN_LAYER),
index 611dee4..249c83c 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -715,6 +715,7 @@ PP(pp_formline)
                SvSETMAGIC(sv);
                break;
            }
+            /* FALLTHROUGH */
 
        case FF_LINESNGL: /* process ^*  */
            chopspace = 0;
@@ -3276,7 +3277,7 @@ Perl_find_runcv_where(pTHX_ U8 cond, IV arg, U32 *db_seqp)
                    return cv;
                case FIND_RUNCV_level_eq:
                    if (level++ != arg) continue;
-                   /* GERONIMO! */
+                    /* FALLTHROUGH */
                default:
                    return cv;
                }
@@ -5377,7 +5378,8 @@ S_doparseform(pTHX_ SV *sv)
            if (s < send) {
                skipspaces = 0;
                 continue;
-            } /* else FALL THROUGH */
+            }
+            /* FALLTHROUGH */
        case '\n':
            arg = s - base;
            skipspaces++;
index 66f27ac..4413342 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef DEBUG_SBOX32_HASH
 #define DEBUG_SBOX32_HASH 0
 
+GCC_DIAG_IGNORE(-Wimplicit-fallthrough)
+
 #include "zaphod32_hash.h"
 
 #if DEBUG_SBOX32_HASH == 1
@@ -1779,5 +1781,6 @@ SBOX32_STATIC_INLINE U32 sbox32_hash128(
     return sbox32_hash_with_state((U8*)state,key,key_len);
 }
 
+GCC_DIAG_RESTORE
 
 #endif
diff --git a/sv.c b/sv.c
index 6dcd99a..19deb76 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1645,6 +1645,7 @@ Perl_sv_setiv(pTHX_ SV *const sv, const IV i)
     case SVt_PVGV:
        if (!isGV_with_GP(sv))
            break;
+        /* FALLTHROUGH */
     case SVt_PVAV:
     case SVt_PVHV:
     case SVt_PVCV:
@@ -1758,6 +1759,7 @@ Perl_sv_setnv(pTHX_ SV *const sv, const NV num)
     case SVt_PVGV:
        if (!isGV_with_GP(sv))
            break;
+        /* FALLTHROUGH */
     case SVt_PVAV:
     case SVt_PVHV:
     case SVt_PVCV:
@@ -16908,6 +16910,7 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv,
        /* def-ness of rval pos() is independent of the def-ness of its arg */
        if ( !(obase->op_flags & OPf_MOD))
            break;
+        /* FALLTHROUGH */
 
     case OP_SCHOMP:
     case OP_CHOMP:
diff --git a/toke.c b/toke.c
index a91a4fc..6c3148d 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -7231,6 +7231,7 @@ Perl_yylex(pTHX)
                orig_keyword = 0;
                lex = 0;
                off = 0;
+            /* FALLTHROUGH */
        default:                        /* not a keyword */
          just_a_word: {
                int pkgname = 0;
diff --git a/vxs.inc b/vxs.inc
index b4aa0c6..0e5e72a 100644 (file)
--- a/vxs.inc
+++ b/vxs.inc
@@ -219,7 +219,7 @@ VXS(version_new)
         SvGETMAGIC(vs);
         if(SvOK(vs))
             break;
-        /* drop through */
+        /* fall through */
     case 1:
         /* no param or explicit undef */
         /* create empty object */