From nobody@FreeBSD.org  Sun Apr 25 19:20:39 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 182D61065673
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <alexbestms@wwu.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [kld] [patch] kldstat(8) contains an obsolete cast
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         146046
>Category:       bin
>Synopsis:       [kld] [patch] kldstat(8) contains an obsolete cast
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brueffer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 25 19:30:02 UTC 2010
>Closed-Date:    Sat Jul 03 14:10:57 CEST 2010
>Last-Modified:  Sat Jul 03 14:10:57 CEST 2010
>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:
State-Changed-From-To: open->patched 
State-Changed-By: brueffer 
State-Changed-When: Wed May 12 17:47:48 CEST 2010 
State-Changed-Why:  
Committed, thanks! 


Responsible-Changed-From-To: freebsd-bugs->brueffer 
Responsible-Changed-By: brueffer 
Responsible-Changed-When: Wed May 12 17:47:48 CEST 2010 
Responsible-Changed-Why:  
MFC reminder 

http://www.freebsd.org/cgi/query-pr.cgi?pr=146046 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/146046: commit references a PR
Date: Wed, 12 May 2010 15:47:57 +0000 (UTC)

 Author: brueffer
 Date: Wed May 12 15:47:43 2010
 New Revision: 207964
 URL: http://svn.freebsd.org/changeset/base/207964
 
 Log:
   Casting size_t to uintmax_t is not necessary anymore. This also
   removes the need for stdint.h inclusion.
   
   PR:		146046
   Submitted by:	Alexander Best <alexbestms@wwu.de>
   Reviewed by:	kan
   MFC after:	1 week
 
 Modified:
   head/sbin/kldstat/kldstat.c
 
 Modified: head/sbin/kldstat/kldstat.c
 ==============================================================================
 --- head/sbin/kldstat/kldstat.c	Wed May 12 13:45:46 2010	(r207963)
 +++ head/sbin/kldstat/kldstat.c	Wed May 12 15:47:43 2010	(r207964)
 @@ -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 @@ static void printfile(int fileid, int ve
      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) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: brueffer 
State-Changed-When: Sat Jul 3 14:10:43 CEST 2010 
State-Changed-Why:  
MFC done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=146046 
>Unformatted:
