bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7325: new test failure due to non-portability of printf formats like


From: Pádraig Brady
Subject: bug#7325: new test failure due to non-portability of printf formats like %05.3s
Date: Thu, 11 Nov 2010 22:09:17 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]