From owner-svn-src-head@FreeBSD.ORG Thu Mar 4 00:14:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E031106566C; Thu, 4 Mar 2010 00:14:53 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 17B2F8FC15; Thu, 4 Mar 2010 00:14:52 +0000 (UTC) Received: by pvg3 with SMTP id 3so668165pvg.13 for ; Wed, 03 Mar 2010 16:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=jUWuhXtPRF/QsKyyHoz/zK6pxjca/m/x1MBczHOuKu4=; b=n4iiGzaP6DScXVa9gnENi2/trmUB1o5nctSSxztMCRxheURCgoOIIqmXfbpft68oas EPWyweaAuf2SxW2/kumZieG9KU480heEFEJAU6UqMhFVD0lVlQw2KSilzN8wNL+pc2nH MpbjjUncEsukyK5Oz0b/lvUIgTpfduKEW7ubw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=qTwsppE8w6gACvtBqkPTJ3WxqGz4clKmu1hQu5aGSe7gTfaR/zi5/x6Yrruc9hb9MX CSz72Q08pOsiGiwL/jW0t1pBQDFdNj6Tf0MwCkXqOxcf/3/UjPFw1a7VLJF4B/CbZQxp rJArsM5UtXWEuJ3X6/8CW6lgBk/le3W1i9o/Q= Received: by 10.142.248.26 with SMTP id v26mr1219196wfh.335.1267661687650; Wed, 03 Mar 2010 16:14:47 -0800 (PST) Received: from [10.70.184.104] ([166.205.137.28]) by mx.google.com with ESMTPS id 23sm3769pzk.6.2010.03.03.16.14.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Mar 2010 16:14:46 -0800 (PST) References: <201003040036.25583.max@love2party.net> Message-Id: <38B3C45B-B617-413F-868C-A25E3651CA59@gmail.com> From: Garrett Cooper To: Max Laier In-Reply-To: <201003040036.25583.max@love2party.net> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7E18) Mime-Version: 1.0 (iPhone Mail 7E18) Date: Wed, 3 Mar 2010 16:14:35 -0800 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Warner Losh Subject: Re: svn commit: r204672 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2010 00:14:53 -0000 On Mar 3, 2010, at 3:36 PM, Max Laier wrote: > On Thursday 04 March 2010 00:25:53 Garrett Cooper wrote: >> On Mar 3, 2010, at 1:53 PM, Warner Losh wrote: >>> Author: imp >>> Date: Wed Mar 3 21:53:25 2010 >>> New Revision: 204672 >>> URL: http://svn.freebsd.org/changeset/base/204672 >>> >>> Log: >>> Cast these to intmax_t before printing to fix build bustage. Better >>> solutions welcome. >>> >>> Modified: >>> head/sbin/newfs/mkfs.c >>> >>> Modified: head/sbin/newfs/mkfs.c >>> === >>> === >>> === >>> === >>> ================================================================== >>> --- head/sbin/newfs/mkfs.c Wed Mar 3 21:47:25 2010 (r204671) >>> +++ head/sbin/newfs/mkfs.c Wed Mar 3 21:53:25 2010 (r204672) >>> @@ -191,8 +191,8 @@ restart: >>> exit(17); >>> } >>> if (sblock.fs_fsize < sectorsize) { >>> - printf("increasing fragment size from %d to sector size >>> (%d) >>> \n", >>> - sblock.fs_fsize, sectorsize); >>> + printf("increasing fragment size from %d to sector size >>> (%jd)\n", >>> + sblock.fs_fsize, (intmax_t)sectorsize); >>> sblock.fs_fsize = sectorsize; >>> } >>> if (sblock.fs_bsize > MAXBSIZE) { >>> @@ -337,8 +337,8 @@ restart: >>> } else if (density < minfragsperinode * fsize) { >>> origdensity = density; >>> density = minfragsperinode * fsize; >>> - fprintf(stderr, "density increased from %d to %d\n", >>> - origdensity, density); >>> + fprintf(stderr, "density increased from %d to %jd\n", >>> + origdensity, (intmax_t)density); >>> } >>> origdensity = density; >>> for (;;) { >>> @@ -346,8 +346,9 @@ restart: >>> if (fragsperinode < minfragsperinode) { >>> bsize <<= 1; >>> fsize <<= 1; >>> - printf("Block size too small for a file system %s %d >>> \n", >>> - "of this size. Increasing blocksize to", bsize); >>> + printf("Block size too small for a file system %s %jd >>> \n", >>> + "of this size. Increasing blocksize to", >>> + (intmax_t)bsize); >>> goto restart; >>> } >>> minfpg = fragsperinode * INOPB(&sblock); >>> @@ -371,7 +372,8 @@ restart: >>> density -= sblock.fs_fsize; >>> } >>> if (density != origdensity) >>> - printf("density reduced from %d to %d\n", origdensity, >>> density); >>> + printf("density reduced from %d to %jd\n", origdensity, >>> + (intmax_t)density); >>> /* >>> * Start packing more blocks into the cylinder group until >>> * it cannot grow any larger, the number of cylinder groups >> >> Use PRId64 from inttypes.h ? > > you just forgot to type ";)" there, didn't you? Eh, not really my intent TBH (although I guess my answer was pretty cheeky looking back). > How are the PRI* macros > better than an intmax_t cast? In my opinion, the intmax_t cast and > %j is the > best, realistic solution for this. I have partitioned in the past > that we > change int64 types to "long long" on platforms with 64bit "long". > That way > you can print int64 types with "%ll" on all platforms. But casting > to intmax > is just as good and the compiler should be able to figure out what > goes on and > make it a no-op. Course it helps to read more dilligently too. It's fine today I suppose, but pardoning my ignorance, are there any archs where in practice today, intmax_t isn't synonymous with int64_t, like maybe some ARM variants? TIA! -Garrett