Fix "fall through" comments
authorTom Tromey <tom@tromey.com>
Tue, 27 Sep 2016 17:18:04 +0000 (11:18 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 5 May 2018 04:04:46 +0000 (22:04 -0600)
This patch updates existing "fall through" comments so that they can
be recognized by gcc's -Wimplicit-fallthrough comment-parsing
heuristic.

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

* s390-tdep.c (s390_process_record): Fix fall-through comments.
* xcoffread.c (scan_xcoff_symtab): Move comment later.
* symfile.c (section_is_mapped): Fix fall-through comment.
* stabsread.c (define_symbol, read_member_functions): Fix
fall-through comment.
* s390-linux-tdep.c (s390_process_record): Fix fall-through
comment.
* remote.c (remote_wait_as): Fix fall-through comment.
* p-exp.y (yylex): Fix fall-through comment.
* nat/x86-dregs.c (x86_length_and_rw_bits): Fix fall-through
comment.
* msp430-tdep.c (msp430_gdbarch_init): Fix fall-through comment.
* mdebugread.c (parse_partial_symbols): Fix fall-through comment.
* jv-exp.y (yylex): Fix fall-through comment.
* go-exp.y (lex_one_token): Fix fall-through comment.
* gdbtypes.c (get_discrete_bounds, rank_one_type): Fix
fall-through comment.
* f-exp.y (yylex): Fix fall-through comment.
* dwarf2read.c (process_die): Fix fall-through comments.
* dbxread.c (process_one_symbol): Fix fall-through comment.
* d-exp.y (lex_one_token): Fix fall-through comment.
* cp-name-parser.y (yylex): Fix fall-through comment.
* coffread.c (coff_symtab_read): Fix fall-through comment.
* c-exp.y (lex_one_token): Fix fall-through comment.
* arm-tdep.c (arm_decode_miscellaneous): Fix fall-through
comment.
* arch/arm.c (arm_instruction_changes_pc): Fix fall-through
comment.

21 files changed:
gdb/ChangeLog
gdb/arch/arm.c
gdb/arm-tdep.c
gdb/c-exp.y
gdb/coffread.c
gdb/cp-name-parser.y
gdb/d-exp.y
gdb/dbxread.c
gdb/dwarf2read.c
gdb/f-exp.y
gdb/gdbtypes.c
gdb/go-exp.y
gdb/mdebugread.c
gdb/msp430-tdep.c
gdb/nat/x86-dregs.c
gdb/p-exp.y
gdb/remote.c
gdb/s390-tdep.c
gdb/stabsread.c
gdb/symfile.c
gdb/xcoffread.c

index f91a9766fd22ee452122858ebc59d63271d1d113..b7ae0e3d2bcfd3ada744f78afaeac9ceb8feed21 100644 (file)
@@ -1,3 +1,34 @@
+2018-05-04  Tom Tromey  <tom@tromey.com>
+
+       * s390-tdep.c (s390_process_record): Fix fall-through comments.
+       * xcoffread.c (scan_xcoff_symtab): Move comment later.
+       * symfile.c (section_is_mapped): Fix fall-through comment.
+       * stabsread.c (define_symbol, read_member_functions): Fix
+       fall-through comment.
+       * s390-linux-tdep.c (s390_process_record): Fix fall-through
+       comment.
+       * remote.c (remote_wait_as): Fix fall-through comment.
+       * p-exp.y (yylex): Fix fall-through comment.
+       * nat/x86-dregs.c (x86_length_and_rw_bits): Fix fall-through
+       comment.
+       * msp430-tdep.c (msp430_gdbarch_init): Fix fall-through comment.
+       * mdebugread.c (parse_partial_symbols): Fix fall-through comment.
+       * jv-exp.y (yylex): Fix fall-through comment.
+       * go-exp.y (lex_one_token): Fix fall-through comment.
+       * gdbtypes.c (get_discrete_bounds, rank_one_type): Fix
+       fall-through comment.
+       * f-exp.y (yylex): Fix fall-through comment.
+       * dwarf2read.c (process_die): Fix fall-through comments.
+       * dbxread.c (process_one_symbol): Fix fall-through comment.
+       * d-exp.y (lex_one_token): Fix fall-through comment.
+       * cp-name-parser.y (yylex): Fix fall-through comment.
+       * coffread.c (coff_symtab_read): Fix fall-through comment.
+       * c-exp.y (lex_one_token): Fix fall-through comment.
+       * arm-tdep.c (arm_decode_miscellaneous): Fix fall-through
+       comment.
+       * arch/arm.c (arm_instruction_changes_pc): Fix fall-through
+       comment.
+
 2018-05-04  Tom Tromey  <tom@tromey.com>
 
        PR python/22730:
index 560b8cc0758c40551f9cd9c6faca0b2c42485e79..41c91ba2a81ba4e5dd8b8dcbe108ef4b512c1cb3 100644 (file)
@@ -153,7 +153,8 @@ arm_instruction_changes_pc (uint32_t this_instr)
               modify PC.  */
            return 0;
          }
-       /* Data processing instruction.  Fall through.  */
+       /* Data processing instruction.  */
+       /* Fall through.  */
 
       case 0x1:
        if (bits (this_instr, 12, 15) == 15)
index 463fcaf94ba5b2a8a0323199b6c1e037366b4f41..a188f0afcf60fd0da43f6a6bb6b0978c896f444c 100644 (file)
@@ -6568,6 +6568,7 @@ arm_decode_miscellaneous (struct gdbarch *gdbarch, uint32_t insn,
       else if (op == 0x3)
         /* Not really supported.  */
        return arm_copy_unmodified (gdbarch, insn, "smc", dsc);
+      /* Fall through.  */
 
     default:
       return arm_copy_undef (gdbarch, insn, dsc);
index 3cee544106f6003037e8e3cd40ce13fa81280992..5e10d2a3b4370bf18aa0d46d924795130b602487 100644 (file)
@@ -2592,7 +2592,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
          last_was_structop = true;
          goto symbol;          /* Nope, must be a symbol. */
        }
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
 
     case '0':
     case '1':
index cad3e7e2f1744f8ee238e7ef3a7eeb1085d9ebd6..192d38c331e79223ad221f17c6f7b67143f2a3f5 100644 (file)
@@ -964,7 +964,8 @@ coff_symtab_read (minimal_symbol_reader &reader,
            /* At least on a 3b1, gcc generates swbeg and string labels
               that look like this.  Ignore them.  */
            break;
-         /* Fall in for static symbols that don't start with '.'  */
+         /* For static symbols that don't start with '.'...  */
+         /* Fall through.  */
        case C_THUMBEXT:
        case C_THUMBEXTFUNC:
        case C_EXT:
index f1077e3aa8931b2156206bb170767e9cb8f6af6c..f522e464191574c878ff65dbfb7ed022a318a951 100644 (file)
@@ -1668,7 +1668,7 @@ yylex (void)
          lexptr++;
          return '-';
        }
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
 
     try_number:
     case '0':
index 03be93fbbc7b3b4320e7eca0549db2ece2a1926b..508927bb00f0858484e274178769fc2bbcd9a398 100644 (file)
@@ -1109,7 +1109,7 @@ lex_one_token (struct parser_state *par_state)
            last_was_structop = 1;
          goto symbol;          /* Nope, must be a symbol.  */
        }
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
 
     case '0':
     case '1':
index bdf4fb9c798394133237bdf54bb26be41d2034d3..d0926896e26cebb06a047692409e6cab858c5f38 100644 (file)
@@ -2883,9 +2883,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
       unknown_symtype_complaint (hex_string (type));
       /* FALLTHROUGH */
 
-      /* The following symbol types don't need the address field
-         relocated, since it is either unused, or is absolute.  */
     define_a_symbol:
+      /* These symbol types don't need the address field relocated,
+         since it is either unused, or is absolute.  */
     case N_GSYM:               /* Global variable.  */
     case N_NSYMS:              /* Number of symbols (Ultrix).  */
     case N_NOMAP:              /* No map?  (Ultrix).  */
index 380ff365bb90dfebec4d0376638f1bda2b6b7a77..26ec5efc286609a5275fcec4e959adb170962bf2 100644 (file)
@@ -10578,7 +10578,8 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
       cu->processing_has_namespace_info = 1;
       if (read_namespace_alias (die, cu))
        break;
-      /* The declaration is not a global namespace alias: fall through.  */
+      /* The declaration is not a global namespace alias.  */
+      /* Fall through.  */
     case DW_TAG_imported_module:
       cu->processing_has_namespace_info = 1;
       if (die->child != NULL && (die->tag == DW_TAG_imported_declaration
index ffd52cf3b1da2866904c2d527e5b85eb9c809f55..e39f68417c2d7e40bb309098ba95f32fc0a6fa60 100644 (file)
@@ -1008,7 +1008,7 @@ yylex (void)
       /* Might be a floating point number.  */
       if (lexptr[1] < '0' || lexptr[1] > '9')
        goto symbol;            /* Nope, must be a symbol.  */
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
       
     case '0':
     case '1':
index 9ecc80f26fd4ee798239159463c29e300779e47d..6d70006081b99c91024f22a92c19d6ebcc793e2e 100644 (file)
@@ -1024,7 +1024,7 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
          *highp = -*lowp - 1;
          return 0;
        }
-      /* ... fall through for unsigned ints ...  */
+      /* fall through */
     case TYPE_CODE_CHAR:
       *lowp = 0;
       /* This round-about calculation is to avoid shifting by
@@ -4145,7 +4145,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
            return INTEGER_CONVERSION_BADNESS;
          else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
            return INTEGER_PROMOTION_BADNESS;
-         /* >>> !! else fall through !! <<< */
+         /* fall through */
        case TYPE_CODE_CHAR:
          /* Deal with signed, unsigned, and plain chars for C++ and
             with int cases falling through from previous case.  */
@@ -4251,7 +4251,7 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
          rank.subrank = distance_to_ancestor (parm, arg, 0);
          if (rank.subrank >= 0)
            return sum_ranks (BASE_CONVERSION_BADNESS, rank);
-         /* else fall through */
+         /* fall through */
        default:
          return INCOMPATIBLE_TYPE_BADNESS;
        }
index a96e65534fdf5ec96a0b0da5eeb9da83d07223b9..936d507c374957a497e350bb0b4ffb5fd9076684 100644 (file)
@@ -1088,7 +1088,7 @@ lex_one_token (struct parser_state *par_state)
            last_was_structop = 1;
          goto symbol;          /* Nope, must be a symbol. */
        }
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
 
     case '0':
     case '1':
index c0bce551489d775af488823bd2a67443994c6c67..59c4c898396c24d5c58cdb7a659e05d0211693c3 100644 (file)
@@ -3698,7 +3698,8 @@ parse_partial_symbols (minimal_symbol_reader &reader,
                  break;
                default:
                  unknown_ext_complaint (debug_info->ssext + psh->iss);
-                 /* Fall through, pretend it's global.  */
+                 /* Pretend it's global.  */
+                 /* Fall through.  */
                case stGlobal:
                  /* Global common symbols are resolved by the runtime loader,
                     ignore them.  */
index 169b7e9505813a5a8c8f592cd3719f9a313c9b4a..b6e062a380fea2bd92b90a70f0e15d01a8493c0f 100644 (file)
@@ -908,8 +908,8 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
              code_model = ca_tdep->code_model;
              break;
            }
-         /* Otherwise, fall through...  */
        }
+       /* Fall through.  */
       default:
        error (_("Unknown msp430 isa"));
        break;
index f11a708e27aaeaf29740b70bbd62c25505c679b7..7604a36342798ceb84cdfa4560ac5a01367d1263 100644 (file)
@@ -253,7 +253,7 @@ Invalid hardware breakpoint type %d in x86_length_and_rw_bits.\n"),
       case 8:
         if (TARGET_HAS_DR_LEN_8)
          return (DR_LEN_8 | rw);
-       /* ELSE FALL THROUGH */
+       /* FALL THROUGH */
       default:
        internal_error (__FILE__, __LINE__, _("\
 Invalid hardware breakpoint length %d in x86_length_and_rw_bits.\n"), len);
index 6b857e1a02338fe258b78f92f495f08e5d0b4d2c..d527b776d9f14ccfd943adc881f88b2eae29d333 100644 (file)
@@ -1224,7 +1224,7 @@ yylex (void)
          goto symbol;          /* Nope, must be a symbol.  */
        }
 
-      /* FALL THRU into number case.  */
+      /* FALL THRU.  */
 
     case '0':
     case '1':
index 34ae7c6921c214c04d3dc05059563c7e94d6cec9..58ed9e4f4d456bb94822fc933fb0526bbeed4e36 100644 (file)
@@ -7675,7 +7675,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
          putpkt (buf);
          break;
        }
-      /* else fallthrough */
+      /* fallthrough */
     default:
       warning (_("Invalid remote reply: %s"), buf);
       break;
index 227c70909ea67c422d7ebc254f50bd22a5aac9f2..4af035fbfcd482efbfc0e26ba0a5c1a8e6de9dbb 100644 (file)
@@ -4318,7 +4318,8 @@ ex:
                      return -1;
                    break;
                  }
-               /* For other instructions, fallthru.  */
+               /* For other instructions... */
+               /* Fall through.  */
              default:
                fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KM* function %02x at %s.\n",
                                    (int)tmp, paddress (gdbarch, addr));
@@ -4620,7 +4621,8 @@ ex:
                      return -1;
                    break;
                  }
-               /* For KLMD, fallthru.  */
+               /* For KLMD...  */
+               /* Fall through.  */
              default:
                fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n",
                                    (int)tmp, paddress (gdbarch, addr));
index 0017f18c35ac5c881c650d556e91b0ea620d043e..8d392906429977a0b8a041ae537e287265b9df44 100644 (file)
@@ -723,7 +723,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
          /* SunPRO (3.0 at least) static variable encoding.  */
          if (gdbarch_static_transform_name_p (gdbarch))
            goto normal;
-         /* ... fall through ...  */
+         /* fall through */
 
        default:
          complaint (&symfile_complaints, _("Unknown C++ symbol name `%s'"),
@@ -2532,7 +2532,8 @@ read_member_functions (struct field_info *fip, const char **pp,
              complaint (&symfile_complaints,
                         _("member function type missing, got '%c'"),
                         (*pp)[-1]);
-             /* Fall through into normal member function.  */
+             /* Normal member function.  */
+             /* Fall through.  */
 
            case '.':
              /* normal member function.  */
index 1122db672ea37cf5d0f252f238d1246a6a26bf11..b0a5f118346673fdec0108446725d544232460c6 100644 (file)
@@ -2901,7 +2901,7 @@ section_is_mapped (struct obj_section *osect)
          if (osect->ovly_mapped == -1)
            gdbarch_overlay_update (gdbarch, osect);
        }
-      /* fall thru to manual case */
+      /* fall thru */
     case ovly_on:              /* overlay debugging manual */
       return osect->ovly_mapped == 1;
     }
index 8c707aa8fe68c56785b53ffea26c4c229d9464a1..66e74439b1aceccca81dcbd2538b133578fdea74 100644 (file)
@@ -2531,9 +2531,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
          }
          /* FALLTHROUGH */
 
+       case C_FCN:
          /* C_FCN is .bf and .ef symbols.  I think it is sufficient
             to handle only the C_FUN and C_EXT.  */
-       case C_FCN:
 
        case C_BSTAT:
        case C_ESTAT: