From owner-svn-src-all@FreeBSD.ORG Mon Jun 1 08:49:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97688420; Mon, 1 Jun 2015 08:49:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF3C1F6A; Mon, 1 Jun 2015 08:49:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 4E26E42635E; Mon, 1 Jun 2015 18:49:22 +1000 (AEST) Date: Mon, 1 Jun 2015 18:49:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcelo Araujo cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283869 - head/contrib/diff/src In-Reply-To: <201506010614.t516EHBC062793@svn.freebsd.org> Message-ID: <20150601183442.O1517@besplex.bde.org> References: <201506010614.t516EHBC062793@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=F6tuKMRN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=GoYidzk2Mr_8KV2Xt_AA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2015 08:49:25 -0000 On Mon, 1 Jun 2015, Marcelo Araujo wrote: > Log: > Fix the wrong format, format specifies type 'int' but the argument has type > 'long', it was spotted by clang. > ... > Modified: head/contrib/diff/src/context.c > ============================================================================== > --- head/contrib/diff/src/context.c Mon Jun 1 06:05:53 2015 (r283868) > +++ head/contrib/diff/src/context.c Mon Jun 1 06:14:17 2015 (r283869) > @@ -62,7 +62,7 @@ print_context_label (char const *mark, > { > time_t sec = inf->stat.st_mtime; > verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); > - sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec); > + sprintf (buf, "%jd.%.9ld", (intmax_t)sec, nsec); It is still a garbage format. It doesn't even misprint 1 second + 3 nanoseconds as 1.3, which looks like 1 second + 300 million nanoseconds. It pads the nanoseconds field with leading spaces, so it misprints 1 second + 3 nanoseconds as "1. 3", which is unparsable. Nanoseconds resolution is too precise for human-readable times, but the times here are unsuitable for human readingfor other reasons. They are apparently for machine reading, but never read. Bruce