[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-bugs
Subject:    bin/22638: fdisk(8) does not compile on amd64
From:       njoly () pasteur ! fr
Date:       2003-08-29 12:17:44
[Download RAW message or body]


> Number:         22638
> Category:       bin
> Synopsis:       fdisk(8) does not compile on amd64
> Confidential:   no
> Severity:       serious
> Priority:       medium
> Responsible:    bin-bug-people
> State:          open
> Class:          sw-bug
> Submitter-Id:   net
> Arrival-Date:   Fri Aug 29 12:18:00 UTC 2003
> Closed-Date:
> Last-Modified:
> Originator:     Nicolas Joly
> Release:        NetBSD 1.6X (-current 20030829)
> Organization:
	Pasteur Institute, Paris.
> Environment:
System: NetBSD calimero2.bis.pasteur.fr 1.6X NetBSD 1.6X (GENERIC.MP) #5: Wed Aug 27 \
17:17:16 CEST 2003 njoly@calimero2.bis.pasteur.fr:/local/src/NetBSD/src/sys/arch/amd64/compile/GENERIC.MP \
                amd64
Architecture: x86_64
Machine: amd64
> Description:
	fdisk(8) does not compile on amd64 platform. On amd64, `uintmax_t'
is defined as `unsigned long int' (`unsigned long long int' for i386), but
value display is done by using `%llu' (fine for i386) instead of `%lu'.
> How-To-Repeat:
njoly@calimero> ./build.sh -U -u -D ../dest -M ../objs -R ../rele -T ../tool build
===> build.sh started: Fri Aug 29 15:26:26 CEST 2003
===> MACHINE:          amd64
===> MACHINE_ARCH:     x86_64
===> TOOLDIR path:     /local/src/NetBSD/src/../tool
===> DESTDIR path:     /local/src/NetBSD/src/../dest
===> RELEASEDIR path:  /local/src/NetBSD/src/../rele
===> makewrapper:      /local/src/NetBSD/src/../tool/bin/nbmake-amd64
===> Updated /local/src/NetBSD/src/../tool/bin/nbmake-amd64
[...]
dependall ===> sbin/fdisk/mbr
/local/src/NetBSD/chain/bin/x86_64--netbsd-gcc -O2  -Wall -Wstrict-prototypes -W
missing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-unini
tialized -Wreturn-type -Wswitch -Wshadow  -Werror   -nostdinc -isystem /local/sr
c/NetBSD/src/../dest/usr/include  -c    /local/src/NetBSD/src/sbin/fdisk/fdisk.c
/local/src/NetBSD/src/sbin/fdisk/fdisk.c: In function `print_part':
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:663: warning: long long unsigned int fo
rmat, long unsigned int arg (arg 4)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c: In function `print_mbr_partition':
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:722: warning: long long unsigned int fo
rmat, long unsigned int arg (arg 4)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:722: warning: long long unsigned int fo
rmat, long unsigned int arg (arg 5)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c: In function `print_params':
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:2012: warning: long long unsigned int f
ormat, long unsigned int arg (arg 5)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:2015: warning: long long unsigned int f
ormat, long unsigned int arg (arg 5)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:2026: warning: long long unsigned int f
ormat, long unsigned int arg (arg 6)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:2031: warning: long long unsigned int f
ormat, long unsigned int arg (arg 6)
/local/src/NetBSD/src/sbin/fdisk/fdisk.c: In function `get_params_to_use':
/local/src/NetBSD/src/sbin/fdisk/fdisk.c:2098: warning: long long int format, u_
int64_t arg (arg 6)
*** Error code 1
> Fix:
All `%llu/%lld' instances must be replaced by `PRIuMAX/PRIdMAX'.

Index: sbin/fdisk/fdisk.c
===================================================================
RCS file: /cvsroot/src/sbin/fdisk/fdisk.c,v
retrieving revision 1.68
diff -u -r1.68 fdisk.c
--- sbin/fdisk/fdisk.c	2003/08/10 10:20:08	1.68
+++ sbin/fdisk/fdisk.c	2003/08/29 11:11:41
@@ -659,7 +659,7 @@
 
 	printf("PART%s%dID=%d\n", e, part, partp->mbrp_typ);
 	printf("PART%s%dSIZE=%u\n", e, part, le32toh(partp->mbrp_size));
-	printf("PART%s%dSTART=%llu\n", e, part,
+	printf("PART%s%dSTART=%" PRIuMAX "\n", e, part,
 	    (uintmax_t)(offset + le32toh(partp->mbrp_start)));
 	printf("PART%s%dFLAG=0x%x\n", e, part, partp->mbrp_flag);
 	printf("PART%s%dBCYL=%d\n", e, part,
@@ -718,7 +718,7 @@
 		    boot->mbr_bootsel.mbrb_nametab[part]);
 #endif
 
-	printf("%*s    start %llu, size %llu",
+	printf("%*s    start %" PRIuMAX ", size %" PRIuMAX,
 	    indent, "", (uintmax_t)start, (uintmax_t)size);
 	if (size != 0) {
 		printf(" (%u MB, Cyls ", SEC_TO_MB(size));
@@ -2008,9 +2008,9 @@
 {
 
 	if (sh_flag) {
-		printf("DLCYL=%d\nDLHEAD=%d\nDLSEC=%d\nDLSIZE=%llu\n",
+		printf("DLCYL=%d\nDLHEAD=%d\nDLSEC=%d\nDLSIZE=%" PRIuMAX "\n",
 			cylinders, heads, sectors, (uintmax_t)disksectors);
-		printf("BCYL=%d\nBHEAD=%d\nBSEC=%d\nBDLSIZE=%llu\n",
+		printf("BCYL=%d\nBHEAD=%d\nBSEC=%d\nBDLSIZE=%" PRIuMAX "\n",
 			dos_cylinders, dos_heads, dos_sectors,
 			(uintmax_t)dos_disksectors);
 		printf("NUMEXTPTN=%d\n", ext.num_ptn);
@@ -2021,12 +2021,12 @@
 	printf("Disk: %s\n", disk);
 	printf("NetBSD disklabel disk geometry:\n");
 	printf("cylinders: %d, heads: %d, sectors/track: %d "
-	    "(%d sectors/cylinder)\ntotal sectors: %llu\n\n",
+	    "(%d sectors/cylinder)\ntotal sectors: %" PRIuMAX "\n\n",
 	    cylinders, heads, sectors, cylindersectors,
 	    (uintmax_t)disksectors);
 	printf("BIOS disk geometry:\n");
 	printf("cylinders: %d, heads: %d, sectors/track: %d "
-	    "(%d sectors/cylinder)\ntotal sectors: %llu\n\n",
+	    "(%d sectors/cylinder)\ntotal sectors: %" PRIuMAX "\n\n",
 	    dos_cylinders, dos_heads, dos_sectors, dos_cylindersectors,
 	    (uintmax_t)dos_disksectors);
 }
@@ -2092,7 +2092,7 @@
 				printf("\nGeometries of known disks:\n");
 			bip = &dl->dl_biosdisks[i];
 			printf("Disk %d: cylinders %u, heads %u, sectors %u"
-				" (%lld sectors, %dMB)\n",
+				" (%" PRIdMAX " sectors, %dMB)\n",
 			    i, bip->bi_cyl, bip->bi_head, bip->bi_sec,
 			    (uintmax_t)bip->bi_lbasecs,
 			    SEC_TO_MB(bip->bi_lbasecs));
> Release-Note:
> Audit-Trail:
> Unformatted:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic