summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-04-27 10:44:25 +0100
committerPádraig Brady <P@draigBrady.com>2015-04-27 10:55:26 +0100
commit0e7ac9a4609248663af76f202418dabf1c13efbe (patch)
treeacefcdcd41c30c14925d3e5e904a27653bbadcdb
parent17fba994bd1620ab5d4bdaeda797c6071f6130b7 (diff)
downloadcoreutils-0e7ac9a4609248663af76f202418dabf1c13efbe.tar.xz
maint: fix printf format for signed integers
With GCC 5 and the newly added warnings from gnulib, ensure the correct signed integer is passed for the printf format, to avoid -Werror=format= failures.
-rw-r--r--src/dd.c2
-rw-r--r--src/factor.c2
-rw-r--r--src/kill.c4
-rw-r--r--src/make-prime-list.c2
-rw-r--r--src/numfmt.c4
-rw-r--r--src/split.c2
-rw-r--r--src/timeout.c2
7 files changed, 9 insertions, 9 deletions
diff --git a/src/dd.c b/src/dd.c
index 321b096d4..6b09bc645 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1685,7 +1685,7 @@ skip_via_lseek (char const *filename, int fdesc, off_t offset, int whence)
error (0, 0, _("warning: working around lseek kernel bug for file "
"(%s)\n of mt_type=0x%0lx -- "
"see <sys/mtio.h> for the list of types"),
- filename, s2.mt_type);
+ filename, s2.mt_type + 0Lu);
errno = 0;
new_position = -1;
}
diff --git a/src/factor.c b/src/factor.c
index f6945342d..4e4d0c7cb 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -2337,7 +2337,7 @@ print_uintmaxes (uintmax_t t1, uintmax_t t0)
r = t1 % 1000000000;
udiv_qrnnd (t0, r, r, t0, 1000000000);
print_uintmaxes (q, t0);
- printf ("%09u", (int) r);
+ printf ("%09u", (unsigned int) r);
}
}
diff --git a/src/kill.c b/src/kill.c
index 49e6ef6e0..83016ed3c 100644
--- a/src/kill.c
+++ b/src/kill.c
@@ -109,8 +109,8 @@ PID is an integer; if negative it identifies a process group.\n\
maximum name width is NAME_WIDTH, and SIGNAME is the name to print. */
static void
-print_table_row (unsigned int num_width, int signum,
- unsigned int name_width, char const *signame)
+print_table_row (int num_width, int signum,
+ int name_width, char const *signame)
{
char const *description = strsignal (signum);
printf ("%*d %-*s %s\n", num_width, signum, name_width, signame,
diff --git a/src/make-prime-list.c b/src/make-prime-list.c
index 69b91e895..b31e1ed26 100644
--- a/src/make-prime-list.c
+++ b/src/make-prime-list.c
@@ -131,7 +131,7 @@ output_primes (const struct prime *primes, unsigned nprimes)
abort ();
printf ("P (%u, %u,\n (", primes[i].p - p, d8);
print_wide_uint (primes[i].pinv, 0, wide_uint_bits);
- printf ("),\n UINTMAX_MAX / %d)\n", primes[i].p);
+ printf ("),\n UINTMAX_MAX / %u)\n", primes[i].p);
p = primes[i].p;
}
diff --git a/src/numfmt.c b/src/numfmt.c
index 550e3845f..9cbcb2753 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -729,7 +729,7 @@ double_to_human (long double val, int precision,
/* Normalize val to scale. */
unsigned int power = 0;
val = expld (val, scale_base, &power);
- devmsg (" scaled value to %Lf * %0.f ^ %d\n", val, scale_base, power);
+ devmsg (" scaled value to %Lf * %0.f ^ %u\n", val, scale_base, power);
/* Perform rounding. */
int ten_or_less = 0;
@@ -757,7 +757,7 @@ double_to_human (long double val, int precision,
int show_decimal_point = (val != 0) && (absld (val) < 10) && (power > 0);
/* && (absld (val) > simple_round_floor (val))) */
- devmsg (" after rounding, value=%Lf * %0.f ^ %d\n", val, scale_base, power);
+ devmsg (" after rounding, value=%Lf * %0.f ^ %u\n", val, scale_base, power);
stpcpy (pfmt, show_decimal_point ? ".1Lf%s" : ".0Lf%s");
diff --git a/src/split.c b/src/split.c
index 8d03c1620..e0f83692b 100644
--- a/src/split.c
+++ b/src/split.c
@@ -521,7 +521,7 @@ closeout (FILE *fp, int fd, pid_t pid, char const *name)
{
/* shouldn't happen. */
error (EXIT_FAILURE, 0,
- _("unknown status from command (0x%X)"), wstatus);
+ _("unknown status from command (0x%X)"), wstatus + 0u);
}
}
}
diff --git a/src/timeout.c b/src/timeout.c
index 4d089bf23..19c07653a 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -492,7 +492,7 @@ main (int argc, char **argv)
else
{
/* shouldn't happen. */
- error (0, 0, _("unknown status from command (0x%X)"), status);
+ error (0, 0, _("unknown status from command (%d)"), status);
status = EXIT_FAILURE;
}
}