]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: we use die; remove now-unnecessary uses of abort
authorJim Meyering <meyering@fb.com>
Sun, 16 Oct 2016 18:28:39 +0000 (11:28 -0700)
committerJim Meyering <meyering@fb.com>
Sun, 16 Oct 2016 18:28:39 +0000 (11:28 -0700)
* src/expr.c (integer_overflow): Remove an abort-after-die.
* src/paste.c (write_error): Likewise.
* src/sort.c (badfieldspec): Likewise.
* src/tr.c (string2_extend): Likewise. Also remove a few
break statements, each after an abort.

src/expr.c
src/paste.c
src/sort.c
src/tr.c

index d7106ecdd752f8c461e7d691f83463bebf19e136..50e2283afe7be2bdcb0cf507e1cbaf8388339a48 100644 (file)
@@ -283,7 +283,6 @@ static void
 integer_overflow (char op)
 {
   die (EXPR_FAILURE, ERANGE, "%c", op);
-  abort (); /* notreached */
 }
 #endif
 
index d6e4b75485bcf90c20b790c62a7e8c3c47772b4d..0cf5d2fc54b124095f642af60766dc92180158b3 100644 (file)
@@ -161,7 +161,6 @@ static void
 write_error (void)
 {
   die (EXIT_FAILURE, errno, _("write error"));
-  abort ();
 }
 
 /* Output a single byte, reporting any write errors.  */
index 5f62d28cdd166d9860471e0078062129e669f395..6d2eec53514b915bd8fcdfed0bd5371d61a76315 100644 (file)
@@ -4036,7 +4036,6 @@ badfieldspec (char const *spec, char const *msgid)
 {
   die (SORT_FAILURE, 0, _("%s: invalid field specification %s"),
        _(msgid), quote (spec));
-  abort ();
 }
 
 /* Report incompatible options.  */
@@ -4046,7 +4045,6 @@ static void
 incompatible_options (char const *opts)
 {
   die (SORT_FAILURE, 0, _("options '-%s' are incompatible"), (opts));
-  abort ();
 }
 
 /* Check compatibility of ordering options.  */
index cdf4ccdc787a2dd66a2408b7b9bd40b9a9d124ab..62048aa1d83c0e19f326533da3e366cd7fe55458 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -408,7 +408,6 @@ is_char_class_member (enum Char_class char_class, unsigned char c)
       break;
     default:
       abort ();
-      break;
     }
 
   return !! result;
@@ -1128,7 +1127,6 @@ get_next (struct Spec_list *s, enum Upper_Lower_class *class)
 
     default:
       abort ();
-      break;
     }
 
   return return_val;
@@ -1301,7 +1299,6 @@ get_spec_stats (struct Spec_list *s)
 
         default:
           abort ();
-          break;
         }
 
       /* Check for arithmetic overflow in computing length.  Also, reject
@@ -1396,8 +1393,6 @@ string2_extend (const struct Spec_list *s1, struct Spec_list *s2)
       die (EXIT_FAILURE, 0,
            _("when translating with string1 longer than string2,\nthe\
  latter string must not end with a character class"));
-      abort (); /* inform gcc that the above use of error never returns. */
-      break;
 
     case RE_REPEATED_CHAR:
       char_to_repeat = p->u.repeated_char.the_repeated_char;
@@ -1407,11 +1402,9 @@ string2_extend (const struct Spec_list *s1, struct Spec_list *s2)
       /* This shouldn't happen, because validate exits with an error
          if it finds an equiv class in string2 when translating.  */
       abort ();
-      break;
 
     default:
       abort ();
-      break;
     }
 
   append_repeated_char (s2, char_to_repeat, s1->length - s2->length);