diff options
author | dim <dim@FreeBSD.org> | 2014-11-22 12:10:09 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-22 12:10:09 +0000 |
commit | f3c5cded787fe5809335d5009e4e2012d3e3829b (patch) | |
tree | 821a1126fabc8451bbe711320e797fba7f1959f5 /usr.bin/locate | |
parent | 31183242f066ae36f29f018862c7c8c2d3b90c1d (diff) | |
download | FreeBSD-src-f3c5cded787fe5809335d5009e4e2012d3e3829b.zip FreeBSD-src-f3c5cded787fe5809335d5009e4e2012d3e3829b.tar.gz |
Fix the following -Werror warning from clang 3.5.0, while building
usr.bin/cpio on amd64 (or any arch with 64-bit time_t):
contrib/libarchive/cpio/cpio.c:1143:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
if (abs(mtime - now) > (365/2)*86400)
^
contrib/libarchive/cpio/cpio.c:1143:6: note: use function 'labs' instead
if (abs(mtime - now) > (365/2)*86400)
^~~
labs
1 error generated.
This is because time_t is a long on amd64. To avoid the warning, just
copy the equivalent test from a few lines before, which is used in the
Windows case, and which is type safe.
Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D1198
Diffstat (limited to 'usr.bin/locate')
0 files changed, 0 insertions, 0 deletions