Date: Sun, 25 Apr 2010 19:20:37 GMT From: Alexander Best <alexbestms@wwu.de> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/146046: [kld] [patch] kldstat(8) contains an obsolete cast Message-ID: <201004251920.o3PJKbkZ004538@www.freebsd.org> Resent-Message-ID: <201004251930.o3PJU2hG055223@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <err.h>
-#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004251920.o3PJKbkZ004538>
