GNU bug report logs - #7325
new test failure due to non-portability of printf formats like %05.3s

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Wed, 3 Nov 2010 18:56:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #116 received at 7325 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 7325 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>,
	Jim Meyering <jim <at> meyering.net>
Subject: Re: bug#7325: new test failure due to non-portability of printf
	formats like %05.3s
Date: Thu, 11 Nov 2010 22:09:17 +0000
On 11/11/10 17:54, Paul Eggert wrote:
> On 11/11/2010 07:24 AM, Eric Blake wrote:
>> %.0X as a mnemonic of 'show full precision but suppress
>> trailing zeros' kind of makes sense
> 
> I had considered supporting those semantics
> as well, which would have avoided all this business with
> fstimeprec.  That is, just trim trailing zeros, and don't
> worry about the file system time stamp resolution.  The problem
> with this approach is that different time stamps for the same
> file (atime, mtime, ctime) might show different numbers of digits,
> which might cause alignment problems and confusion.
> 
> I'm a bit leery of %.0X as meaning "show more than zero digits
> of precision", since .0 always means show zero everywhere else
> that printf-style formats are used.

Yes it's not ideal.

> I'm still not quite following the backward compatibility argument,
> as no matter what we do, we'll have different functionality than
> before.  %#.X outputs an integer time stamp with coreutils 5.97
> and outputs nothing with coreutils 8.6.  %.0X is the same as
> %#.X, so they're both equally "bad" in that respect.  %.*X outputs
> "*X" with 5.97 and "?X" with 8.6, so it's not portable either.

Yes 8.6 is special in this regard which is why
we're trying to release 8.7 quickly so as not
to have to worry about it.

> It's
> not a big deal, but I still mildly prefer the * notation.

Well I'm OK with %.0X %#.X or %.*X
so I've nothing more to add.

cheers,
Pádraig.




This bug report was last modified 14 years and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.