From dan@obluda.cz  Mon Jun 24 19:05:43 2002
Return-Path: <dan@obluda.cz>
Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106])
	by hub.freebsd.org (Postfix) with ESMTP id 67E7237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Jun 2002 19:05:39 -0700 (PDT)
Received: from obluda.cz (localhost [127.0.0.1])
	by xkulesh.vol.cz (8.12.3/8.12.3) with ESMTP id g5P25aTt054187
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Jun 2002 04:05:36 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by obluda.cz (8.12.4/8.12.4/Submit) id g5P1waQO054081;
	Tue, 25 Jun 2002 03:58:36 +0200 (CEST)
Message-Id: <200206250158.g5P1waQO054081@obluda.cz>
Date: Tue, 25 Jun 2002 03:58:36 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cleaning sbin/disklabel code from warnings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39817
>Category:       bin
>Synopsis:       cleaning sbin/disklabel code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 24 19:10:02 PDT 2002
>Closed-Date:    Sat Aug 03 19:44:15 PDT 2002
>Last-Modified:  Sat Aug 03 19:44:15 PDT 2002
>Originator:     Dan Lukes
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD xkulesh.vol.cz 4.6-STABLE FreeBSD
sbin/disklabel/disklabel.c,v 1.28.2.9 2001/08/01 06:07:14

>Description:
I want to clean some warnings from code.

sbin/disklabel/disklabel.c: In function `checklabel':
1445: warning: int format, long int arg (arg 3)

unsigned long 'total_percent' printf'ed as %d

1464: warning: unknown conversion type character `'' in format

'%' character must be doubled in format string

1497: warning: long int format, int arg (arg 3)

u_int32_t (e.g. unsigned int) pp->p_offset printf'ed as %ld

>How-To-Repeat:
	N/A
>Fix:

--- sbin/disklabel/disklabel.c.ORIG    Tue Aug  7 20:10:14 2001
+++ sbin/disklabel/disklabel.c Tue Jun 25 03:55:30 2002
@@ -1441,7 +1441,7 @@
        if (total_percent != 0) {
                long free_space = lp->d_secperunit - total_size;
                if (total_percent > 100) {
-                       fprintf(stderr,"total percentage %d is greater than 100\n",
+                       fprintf(stderr,"total percentage %lu is greater than 100\n",
                            total_percent);
                        errors++;
                }
@@ -1460,7 +1460,7 @@
                        }
                } else {
                        fprintf(stderr,
-                           "%ld sectors available to give to '*' and '%' partitions\n",
+                           "%ld sectors available to give to '*' and '%%' partitions\n",
                            free_space);
                        errors++;
                        /* fix?  set all % partitions to size 0? */
@@ -1493,7 +1493,7 @@
                                if (pp->p_offset < current_offset &&
                                    seen_default_offset && i != FULL_DISK_PART) {
                                        fprintf(stderr,
-"Offset %ld for partition %c overlaps previous partition which ends at %ld\n",
+"Offset %d for partition %c overlaps previous partition which ends at %ld\n",
                                            pp->p_offset,i+'a',current_offset);
                                        fprintf(stderr,
 "Labels with any *'s for offset must be in ascending order by sector\n");
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sat Aug 3 19:39:46 PDT 2002 
State-Changed-Why:  
This was fixed in rev 1.49 in current. 
This kind of fixes are hardly ever MFCed. 

Since all changes like this goes to into current, 
if you want to send other patches to remove  
warning, please send them for current instead. 



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