summaryrefslogtreecommitdiff
path: root/src/dd.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-04-22 01:07:01 +0100
committerPádraig Brady <P@draigBrady.com>2015-04-22 11:11:19 +0100
commit8878c4ef1b88fd07a48ccd7df6bff7ba0929dad7 (patch)
treef427316aa66d271bfc031d1701629d5e2a69a212 /src/dd.c
parent01f4065b129c6ad55eef765e701d0e20342867c7 (diff)
downloadcoreutils-8878c4ef1b88fd07a48ccd7df6bff7ba0929dad7.tar.xz
maint: avoid -Werror=strict-overflow warnings with GCC 5
All warnings were of the form: "assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]" * src/dd.c (cache_round): Use an appropriately sized unsigned type, to avoid possibility of undefined signed overflow. * src/mknod.c (main): Likewise. * src/pr.c (pad_down): Likewise. * src/wc.c (main): Likewise. * src/tail.c (main): Assert that argc >= 0 thus allowing the compiler to assume without implication that argc - optind is positive.
Diffstat (limited to 'src/dd.c')
-rw-r--r--src/dd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dd.c b/src/dd.c
index e78f2a290..321b096d4 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -987,7 +987,7 @@ cache_round (int fd, off_t len)
if (len)
{
- off_t c_pending = *pending + len;
+ uintmax_t c_pending = *pending + len;
*pending = c_pending % page_size;
if (c_pending > *pending)
len = c_pending - *pending;