From owner-svn-src-head@FreeBSD.ORG Thu Jul 18 02:04:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA6FAA57; Thu, 18 Jul 2013 02:04:45 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 256E4BC6; Thu, 18 Jul 2013 02:04:44 +0000 (UTC) Received: from [127.0.0.1] (ns.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.6/8.14.6) with ESMTP id r6I1o2Nl025896; Thu, 18 Jul 2013 09:50:03 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <51E749EA.7000807@FreeBSD.org> Date: Thu, 18 Jul 2013 09:50:34 +0800 From: Kevin Lo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r253402 - head/tools/regression/aio/aiop References: <201307170054.r6H0sLEc065384@svn.freebsd.org> <20130717174435.C1577@besplex.bde.org> In-Reply-To: <20130717174435.C1577@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Jul 2013 02:04:46 -0000 Bruce Evans wrote: > On Wed, 17 Jul 2013, Kevin Lo wrote: > >> Log: >> Use PRId64 instead of %gd to print an int64_t. > > This is a different printf format error, and a style bug. > > Printf format errors: > commit log: %gd doesn't exist. You mean %qd > old: file_size has type off_t, but was printed using %qd. off_t is only > accidentally the same as quad_t > new: file_size has type off_t, but is printed using %PRId64. off_t is > only > accidentally the same as int64_t. > > Style bug: the PRI* mistake should never be used. > > Fix for printf format errors: don't assume anything about off_t except > its specification that it is a signed integer type. Convert it to > intmax_t > for printing. > > Fix for style bug: use %jd to print the intmax_t. > > The PRI* mistake is especially large for intmax_t and uintmax_t. It > lets you spell %jd as %PRIdMAX. PRI* is redundant for intmax_t and > uintmax_t because there is a format letter ('j') for these types. No > other PRI* has this redundancy bug. For example, there is no PRI* for > ssize_t or size_t. The format letter for these types ('z') handles > them better, just like the 'j' does for intmax_t and uintmax_t. Fixed. Thanks for spotting that. > > Bruce > Kevin