summaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
commit08bc9e01c274a01d107b348f921e1c74dd04bd3a (patch)
tree25348bff03c29d9dd6c6dd96bf82c7c9f9265ccf /src/expr.c
parentb9c7373f203ab77c58cb6b131f8b58236ea337a2 (diff)
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-08bc9e01c274a01d107b348f921e1c74dd04bd3a.tar.gz
Merge tag 'upstream/8.23'
Upstream version 8.23
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/expr.c b/src/expr.c
index b4fa808a..a97663a1 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1,5 +1,5 @@
/* expr -- evaluate expressions.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,8 +44,6 @@
int, the widest unsigned type that GMP supports. */
verify (SIZE_MAX <= ULONG_MAX);
-static void integer_overflow (char) ATTRIBUTE_NORETURN;
-
#ifndef HAVE_GMP
# define HAVE_GMP 0
#endif
@@ -53,6 +51,7 @@ static void integer_overflow (char) ATTRIBUTE_NORETURN;
#if HAVE_GMP
# include <gmp.h>
#else
+static void integer_overflow (char) ATTRIBUTE_NORETURN;
/* Approximate gmp.h well enough for expr.c's purposes. */
typedef intmax_t mpz_t[1];
static void mpz_clear (mpz_t z) { (void) z; }
@@ -278,6 +277,7 @@ syntax_error (void)
error (EXPR_INVALID, 0, _("syntax error"));
}
+#if ! HAVE_GMP
/* Report an integer overflow for operation OP and exit. */
static void
integer_overflow (char op)
@@ -285,15 +285,7 @@ integer_overflow (char op)
error (EXPR_FAILURE, ERANGE, "%c", op);
abort (); /* notreached */
}
-
-static void die (int errno_val, char const *msg)
- ATTRIBUTE_NORETURN;
-static void
-die (int errno_val, char const *msg)
-{
- error (EXPR_FAILURE, errno_val, "%s", msg);
- abort (); /* notreached */
-}
+#endif
int
main (int argc, char **argv)