Subject: Re: Another build failure
To: None <paul@whooppee.com>
From: Nicolas Joly <njoly@pasteur.fr>
List: current-users
Date: 02/05/2007 15:55:30
--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Feb 05, 2007 at 06:52:06AM -0800, Charlie Root wrote:
> This one is port-specific, fails on amd64 but succeeds on i386.  All 
> sources updated via CVS at 2007-02-04 12:43 GMT...
> 
> cc1: warnings being treated as errors
> /usr/src/sbin/init/init.c: In function 'mfs_dev':
> /usr/src/sbin/init/init.c:1701: warning: format '%d' expects type 'int', 
> but argument 3 has type 'size_t'
> /usr/src/sbin/init/init.c:1736: warning: format '%d' expects type 'int', 
> but argument 2 has type 'size_t'

Yep. What about the following patch ?

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="netbsd-init.diff"

Index: sbin/init/init.c
===================================================================
RCS file: /cvsroot/src/sbin/init/init.c,v
retrieving revision 1.84
diff -u -r1.84 init.c
--- sbin/init/init.c	4 Feb 2007 20:53:19 -0000	1.84
+++ sbin/init/init.c	5 Feb 2007 14:53:47 -0000
@@ -1698,7 +1698,7 @@
 	/* Mount an mfs over /dev so we can create devices */
 	switch ((pid = fork())) {
 	case 0:
-		(void)asprintf(&fs_size, "%d", FSSIZE);
+		(void)asprintf(&fs_size, "%zd", FSSIZE);
 		if (fs_size == NULL)
 			return(-1);
 		(void)execl(INIT_MOUNT_MFS, "mount_mfs",
@@ -1733,7 +1733,7 @@
 
 	(void)freopen(_PATH_CONSOLE, "a", stderr);
 
-	warnx("Creating mfs /dev (%d blocks, %d inodes)", FSSIZE, NINODE);
+	warnx("Creating mfs /dev (%zd blocks, %d inodes)", FSSIZE, NINODE);
 
 	/* Create a MAKEDEV script in the mfs /dev */
 	writefile(&mfile[0]);

--VbJkn9YxBvnuCH5J--