From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 25 13:29:15 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 F2966AD6; Tue, 25 Nov 2014 13:29:14 +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 C2C50A8B; Tue, 25 Nov 2014 13:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAPDTEtm061867; Tue, 25 Nov 2014 13:29:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAPDTEBj061866; Tue, 25 Nov 2014 13:29:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411251329.sAPDTEBj061866@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 13:29:14 +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: r275039 - in stable: 10/usr.sbin/bsnmpd/modules/snmp_hostres 7/usr.sbin/bsnmpd/modules/snmp_hostres 8/usr.sbin/bsnmpd/modules/snmp_hostres 9/usr.sbin/bsnmpd/modules/snmp_hostres 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 13:29:15 -0000 Author: dim Date: Tue Nov 25 13:29:13 2014 New Revision: 275039 URL: https://svnweb.freebsd.org/changeset/base/275039 Log: MFC r274900: Fix the following -Werror warnings from clang 3.5.0, while building bsnmpd's snmp_hostres module: usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); ^ usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); ^~~ labs usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); ^ usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); ^~~ labs Since tm::tm_gmtoff is a long, use labs(3) instead. Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Directory Properties: stable/10/ (props changed) stable/7/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Tue Nov 25 13:12:45 2014 (r275038) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Tue Nov 25 13:29:13 2014 (r275039) @@ -201,8 +201,8 @@ make_date_time(u_char *str, const struct else str[8] = '+'; - str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600); - str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60); + str[9] = (u_char)(labs(tm->tm_gmtoff) / 3600); + str[10] = (u_char)((labs(tm->tm_gmtoff) % 3600) / 60); return (11); }