bug-gnulib
[Top][All Lists]
Advanced

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

Re: Strftime: negative years


From: Eric Blake
Subject: Re: Strftime: negative years
Date: Wed, 15 Jun 2011 16:03:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110419 Red Hat/3.1.10-1.el6_0 Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/15/2011 02:44 PM, Steven Abner wrote:
> Hi,
>   First sorry to bother, second thank you for providing source code worthy of 
> a good
> shake down, third, arghhh, using negative years I found the return value to 
> be off.
> 
> Using "%V/%u/%010G", which was the flag and field we matched,
> and creating a struct of Jan 1 dates, the return value differed.
> The output to buffers where identical, yours reported a different
> length. I haven't tried other than "%G" as a test from +- 2^29 of every
> first of the year took a while.

Your description is a bit too broad to say what exactly you are finding
wrong, other than you found at least one case where identical input to
two strftime() implementations gave different output.  Please help us
help you, by giving an exact 'struct tm' contents where our strftime()
implementation is differing from yours, along with the output of both
versions, preferably as a standalone C program that can easily be
compiled against either strftime() implementation, so that we can help
pinpoint which of the two (if not both) implementations have a bug.

Meanwhile, remember that POSIX documents that tm_year < -1899 produces
unspecified results, since year 0 does not exist in the Gregorian or
Julian calendar, so any use of %V or %Y on -1900 can meaningfully
produce either "0" or "-1"

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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