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 #44 received at 7325 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 7325 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#7325: new test failure due to non-portability of printf
	formats like %05.3s
Date: Fri, 05 Nov 2010 19:34:07 +0100
Jim Meyering wrote:
> Paul Eggert wrote:
>> On 11/04/10 00:56, Jim Meyering wrote:
>>
>>> However, what about Eric's example?
>>>
>>>   $ src/stat-p -c '_%-0 010.4:X_' k  # yours
>>>   _234       _
>>>   $ src/stat-j -c '_%-0 010.4:X_' k  # mine
>>>   _0234      _
>>
>> That's simply an issue of whether the value is considered to be signed
>> or unsigned, and can be fixed by the patch at the end of this message.
>>
>> However, let me take a step back a minute.  Do users really want all
>> this functionality?  Personally, what I'd like to see is a single
>> format like this:
>>
>>    %.3X
>>
>> that prints out the entire seconds since the Epoch, truncated
>> to millseconds.  That's simpler than what we require now:
>>
>>    %X.%.3:X
>>
>> The changelogs suggest that we used to do things the simpler way,
>> but changed on Oct. 21.  I don't recall this being discussed: I
>
> It was due to portability concerns, since with coreutils-8.6,
> %X, %Y, etc. expanded to floating point values, and that broke
> backwards compatibility:
>
>   http://thread.gmane.org/gmane.comp.gnu.coreutils.general/161/focus=366
>
> However, enabling floating point output only when there is a ".PREC"
> part of the format sounds like a fine compromise.
> Sure, old scripts that used %.3X (expecting no ".") would break,
> but I doubt any such uses exist, since that notation did nothing useful.
>
> A patch would be most welcome.

Hi Paul,
Please let us know whether you are working on this.




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

Previous Next


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