Fix "obvious" fall-through warnings
authorTom Tromey <tom@tromey.com>
Tue, 27 Sep 2016 17:28:18 +0000 (11:28 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 5 May 2018 04:04:46 +0000 (22:04 -0600)
This patch fixes the subset of -Wimplicit-fallthrough warnings that I
considered obvious.  In most cases it was obvious from context that
falling through was desired; here I added the appropriate comment.  In
a couple of cases it seemed clear that a "break" was missing.

ChangeLog
2018-05-04  Tom Tromey  <tom@tromey.com>

* riscv-tdep.c (riscv_isa_xlen): Add fall-through comment.
* utils.c (can_dump_core) <LIMIT_CUR>: Add fall-through comment.
* eval.c (fetch_subexp_value) <MEMORY_ERROR>: Add fall-through
comment.
* d-valprint.c (d_val_print) <TYPE_CODE_STRUCT>: Add fall-through
comment.
* coffread.c (coff_symtab_read) <C_LABEL>: Add fall-through
comment.

gdb/ChangeLog
gdb/coffread.c
gdb/d-valprint.c
gdb/eval.c
gdb/riscv-tdep.c
gdb/utils.c

index d627749de6180680722c07eb6db2ad9e3b6417c4..4bdd444cf0729a8fa7abe6e572d20af9602f229f 100644 (file)
@@ -1,3 +1,14 @@
+2018-05-04  Tom Tromey  <tom@tromey.com>
+
+       * riscv-tdep.c (riscv_isa_xlen): Add fall-through comment.
+       * utils.c (can_dump_core) <LIMIT_CUR>: Add fall-through comment.
+       * eval.c (fetch_subexp_value) <MEMORY_ERROR>: Add fall-through
+       comment.
+       * d-valprint.c (d_val_print) <TYPE_CODE_STRUCT>: Add fall-through
+       comment.
+       * coffread.c (coff_symtab_read) <C_LABEL>: Add fall-through
+       comment.
+
 2018-05-04  Tom Tromey  <tom@tromey.com>
 
        * dwarf2loc.c (unimplemented): Add ATTRIBUTE_NORETURN.
index 192d38c331e79223ad221f17c6f7b67143f2a3f5..f24ec0713a09007293d9d36c86e996691155f04e 100644 (file)
@@ -928,6 +928,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
             backtraces, so filter them out (from phdm@macqel.be).  */
          if (within_function)
            break;
+         /* Fall through.  */
        case C_STAT:
        case C_THUMBLABEL:
        case C_THUMBSTAT:
index e2d84313627bcb99000992a0ea45f363e3e57c4d..579d3c8c9166ba233256ec125869df8f97563f95 100644 (file)
@@ -88,6 +88,7 @@ d_val_print (struct type *type, int embedded_offset,
                                  stream, recurse, val, options);
        if (ret == 0)
          break;
+       /* Fall through.  */
       default:
        c_val_print (type, embedded_offset, address, stream,
                     recurse, val, options);
index 806a7023d2c516f707c827a81adbe1f377bd596a..5bd6e2cbfea489c6baa775c84378c51610323c81 100644 (file)
@@ -215,6 +215,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
        case MEMORY_ERROR:
          if (!preserve_errors)
            break;
+         /* Fall through.  */
        default:
          throw_exception (ex);
          break;
index 149e5e3cec9eed244ffb3d92acb369d433fd0d93..9fa458b79b5832679e9b11f1b66b7efc7fbbcad4 100644 (file)
@@ -369,6 +369,7 @@ riscv_isa_xlen (struct gdbarch *gdbarch)
     {
     default:
       warning (_("unknown xlen size, assuming 4 bytes"));
+      /* Fall through.  */
     case 1:
       return 4;
     case 2:
index e274f026764c76458b0e29e8ca1028756edb020c..63929b2a54c3d6b4f9331f4de5046d37143d57b3 100644 (file)
@@ -275,6 +275,7 @@ can_dump_core (enum resource_limit_kind limit_kind)
     case LIMIT_CUR:
       if (rlim.rlim_cur == 0)
        return 0;
+      /* Fall through.  */
 
     case LIMIT_MAX:
       if (rlim.rlim_max == 0)