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.
This commit is contained in:
Jim Meyering committed 2016-10-16 11:28:39 -07:00
1 parent 492dcb2eb1
commit f8b8bbc1b9
4 files changed
-11

No files matched your search

-1
View File
@@ -283,7 +283,6 @@ static void
integer_overflow (char op)
{
die (EXPR_FAILURE, ERANGE, "%c", op);
abort (); /* notreached */
}
#endif
-1
View 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. */
-2
View 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. */
-7
View File
@@ -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);