summaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-05-18 17:49:32 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-05-18 17:55:07 -0700
commit478dade09a4288f73e963b7f185ef9f73b681b42 (patch)
treedf50bffa4c4d045b20ead3e3d945e39108088acc /src/expr.c
parente605e40acf859eea2a1221d867ab3c086a1a1c15 (diff)
downloadcoreutils-478dade09a4288f73e963b7f185ef9f73b681b42.tar.xz
maint: port --enable-gcc-warnings to clang
* configure.ac: If clang, add -Wno-format-extra-args and -Wno-tautological-constant-out-of-range-compare. * gl/lib/rand-isaac.c (ind): * gl/lib/randread.c (readisaac): * src/ls.c (dev_ino_push, dev_ino_pop): * src/sort.c (buffer_linelim): * src/system.h (is_nul): * src/tail.c (tail_forever_inotify): Rewrite to avoid casts that clang dislikes. It's good to avoid casts anyway. * src/expr.c (integer_overflow): Declare only if it exists. (die): Remove; unused. * src/ls.c (dev_ino_push): New function, replacing ... (DEV_INO_PUSH): ... this removed macro. All uses changed. (decode_switches): Rewrite "str"+i to &str[i].
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/expr.c b/src/expr.c
index b4fa808a0..9d21ca87f 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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)