summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-10-16 11:28:39 -0700
committerJim Meyering <meyering@fb.com>2016-10-16 11:28:39 -0700
commitf8b8bbc1b97c9cb7a56aae79451bf87ab7307cd2 (patch)
tree242a08bd45f3e09f33e372618d5ab248ad835e3d /src
parent492dcb2eb191b844a2fd5e51db3eed85289bea1f (diff)
downloadcoreutils-f8b8bbc1b97c9cb7a56aae79451bf87ab7307cd2.tar.xz
maint: we use die; remove now-unnecessary uses of abort
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/expr.c1
-rw-r--r--src/paste.c1
-rw-r--r--src/sort.c2
-rw-r--r--src/tr.c7
4 files changed, 0 insertions, 11 deletions
diff --git a/src/expr.c b/src/expr.c
index d7106ecdd..50e2283af 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -283,7 +283,6 @@ static void
integer_overflow (char op)
{
die (EXPR_FAILURE, ERANGE, "%c", op);
- abort (); /* notreached */
}
#endif
diff --git a/src/paste.c b/src/paste.c
index d6e4b7548..0cf5d2fc5 100644
--- a/src/paste.c
+++ b/src/paste.c
@@ -161,7 +161,6 @@ static void
write_error (void)
{
die (EXIT_FAILURE, errno, _("write error"));
- abort ();
}
/* Output a single byte, reporting any write errors. */
diff --git a/src/sort.c b/src/sort.c
index 5f62d28cd..6d2eec535 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -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. */
diff --git a/src/tr.c b/src/tr.c
index cdf4ccdc7..62048aa1d 100644
--- 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);