From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 25 12:19:06 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F1C69A5; Tue, 25 Nov 2014 12:19:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20C4BFDB; Tue, 25 Nov 2014 12:19:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAPCJ5XM025726; Tue, 25 Nov 2014 12:19:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAPCJ5Ac025725; Tue, 25 Nov 2014 12:19:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411251219.sAPCJ5Ac025725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 25 Nov 2014 12:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275031 - in stable: 10/contrib/libarchive/cpio 9/contrib/libarchive/cpio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2014 12:19:06 -0000 Author: dim Date: Tue Nov 25 12:19:05 2014 New Revision: 275031 URL: https://svnweb.freebsd.org/changeset/base/275031 Log: MFC r274846: 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 Differential Revision: https://reviews.freebsd.org/D1198 Modified: stable/9/contrib/libarchive/cpio/cpio.c Directory Properties: stable/9/contrib/libarchive/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libarchive/cpio/cpio.c Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/9/contrib/libarchive/cpio/cpio.c Tue Nov 25 11:23:12 2014 (r275030) +++ stable/9/contrib/libarchive/cpio/cpio.c Tue Nov 25 12:19:05 2014 (r275031) @@ -1016,7 +1016,8 @@ list_item_verbose(struct cpio *cpio, str else fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M"; #else - if (abs(mtime - now) > (365/2)*86400) + if (mtime - now > 365*86400/2 + || mtime - now < -365*86400/2) fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y"; else fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";