From owner-freebsd-bugs Sat Jan 18 6:20: 6 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DF4237B401 for ; Sat, 18 Jan 2003 06:20:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDEC343F13 for ; Sat, 18 Jan 2003 06:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0IEK1NS029122 for ; Sat, 18 Jan 2003 06:20:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0IEK1BS029121; Sat, 18 Jan 2003 06:20:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D249437B401 for ; Sat, 18 Jan 2003 06:13:02 -0800 (PST) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B56143EB2 for ; Sat, 18 Jan 2003 06:13:02 -0800 (PST) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe (frog.fafoe [192.168.2.101]) by fafoe.dyndns.org (Postfix) with ESMTP id 123C54159; Sat, 18 Jan 2003 15:12:52 +0100 (CET) Received: by frog.fafoe (Postfix, from userid 1001) id 4575E7CE; Sat, 18 Jan 2003 15:12:52 +0100 (CET) Message-Id: <20030118141252.4575E7CE@frog.fafoe> Date: Sat, 18 Jan 2003 15:12:52 +0100 (CET) From: Stefan Farfeleder Reply-To: Stefan Farfeleder To: FreeBSD-gnats-submit@FreeBSD.org Cc: stefan@fafoe.dyndns.org X-Send-Pr-Version: 3.113 Subject: misc/47187: [patch] fix printf specifier in src/sys/boot/common/bcache.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 47187 >Category: misc >Synopsis: [patch] fix printf specifier in src/sys/boot/common/bcache.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 18 06:20:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD frog.fafoe 5.0-CURRENT FreeBSD 5.0-CURRENT #11: Fri Jan 17 23:42:54 CET 2003 freebsd@frog.fafoe:/freebsd/current/obj/freebsd/current/src/sys/FROG i386 >Description: The bc_blkno member of struct bcachectl which has type daddr_t (a typedef for __int64_t from ) is printed with %08x which expects a value with type unsigned int to be passed. The patch casts the expression to uintmax_t and the specifier is changed to %08jx. >How-To-Repeat: A make buildworld gives this warning: cc -O -pipe -mcpu=pentiumpro -ffreestanding -DLOADER_NFS_SUPPORT -DBOOT_FORTH -I/freebsd/current/src/sys/boot/i386/loader/../../ficl -I/freebsd/current/src/sys/boot/i386/loader/../../ficl/i386 -DLOADER_GZIP_SUPPORT -I/freebsd/current/src/sys/boot/i386/loader/../../common -I/freebsd/current/src/sys/boot/i386/loader/../../.. -I. -Wall -I/freebsd/current/src/sys/boot/i386/loader/.. -I/freebsd/current/src/sys/boot/i386/loader/../../../../lib/libstand/ -I/freebsd/current/src/sys/boot/i386/loader/../btx/lib -elf -ffreestanding -mpreferred-stack-boundary=2 -ffreestanding -mpreferred-stack-boundary=2 -c /freebsd/current/src/sys/boot/common/bcache.c /freebsd/current/src/sys/boot/common/bcache.c: In function `command_bcache': /freebsd/current/src/sys/boot/common/bcache.c:339: warning: unsigned int format, different type arg (arg 2) >Fix: --- bcache.c.diff begins here --- Index: src/sys/boot/common/bcache.c =================================================================== RCS file: /usr/home/ncvs/src/sys/boot/common/bcache.c,v retrieving revision 1.11 diff -c -r1.11 bcache.c *** src/sys/boot/common/bcache.c 25 Feb 2002 03:45:09 -0000 1.11 --- src/sys/boot/common/bcache.c 18 Jan 2003 14:03:59 -0000 *************** *** 30,35 **** --- 30,36 ---- * Simple LRU block cache */ + #include #include #include #include *************** *** 336,342 **** u_int i; for (i = 0; i < bcache_nblks; i++) { ! printf("%08x %04x %04x|", bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff); if (((i + 1) % 4) == 0) printf("\n"); } --- 337,343 ---- u_int i; for (i = 0; i < bcache_nblks; i++) { ! printf("%08jx %04x %04x|", (uintmax_t)bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff); if (((i + 1) % 4) == 0) printf("\n"); } --- bcache.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message