From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 25 19:30:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53B881065670 for ; Sun, 25 Apr 2010 19:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 17E358FC12 for ; Sun, 25 Apr 2010 19:30:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3PJU2GR055226 for ; Sun, 25 Apr 2010 19:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3PJU2hG055223; Sun, 25 Apr 2010 19:30:02 GMT (envelope-from gnats) Resent-Date: Sun, 25 Apr 2010 19:30:02 GMT Resent-Message-Id: <201004251930.o3PJU2hG055223@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Best Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 182D61065673 for ; Sun, 25 Apr 2010 19:20:39 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9748FC12 for ; Sun, 25 Apr 2010 19:20:38 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o3PJKbb1004539 for ; Sun, 25 Apr 2010 19:20:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o3PJKbkZ004538; Sun, 25 Apr 2010 19:20:37 GMT (envelope-from nobody) Message-Id: <201004251920.o3PJKbkZ004538@www.freebsd.org> Date: Sun, 25 Apr 2010 19:20:37 GMT From: Alexander Best To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/146046: [kld] [patch] kldstat(8) contains an obsolete cast X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 19:30:03 -0000 >Number: 146046 >Category: bin >Synopsis: [kld] [patch] kldstat(8) contains an obsolete cast >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Apr 25 19:30:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Alexander Best >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD otaku 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r207154M: Sat Apr 24 21:14:37 CEST 2010 root@otaku:/usr/obj/usr/src/sys/ARUNDEL amd64 >Description: 7 years ago a cast of stat.size to uintmax_t in order to make kldstat.c WARNS=5 clean was introduced [1]. it appears that back then printf(3) couldn't handle size_t. since nowadays printf(3) is able to, make use of it. with the removal of the cast to uintmax_t inclusion of stdint.h is no longer required. [1] in revision 113933 >How-To-Repeat: >Fix: apply the attached patch. Patch attached with submission follows: Index: sbin/kldstat/kldstat.c =================================================================== --- sbin/kldstat/kldstat.c (revision 207014) +++ sbin/kldstat/kldstat.c (working copy) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -60,8 +59,8 @@ if (kldstat(fileid, &stat) < 0) warn("can't stat file id %d", fileid); else - printf("%2d %4d %p %-8jx %s", - stat.id, stat.refs, stat.address, (uintmax_t)stat.size, + printf("%2d %4d %p %-8zx %s", + stat.id, stat.refs, stat.address, stat.size, stat.name); if (verbose) { >Release-Note: >Audit-Trail: >Unformatted: