Bug 1162218 - strftime(3) manpage should specify struct tm elements used/ignored
Summary: strftime(3) manpage should specify struct tm elements used/ignored
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages
Version: 22
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Nikola Forró
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-10 14:44 UTC by Jeremy Harris
Modified: 2016-04-02 04:17 UTC (History)
5 users (show)

Fixed In Version: man-pages-3.81-5.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-02 04:17:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jeremy Harris 2014-11-10 14:44:34 UTC
Description of problem:
  The manpage for strftime does not specify what data it uses.  The elements
of "struct tm" overlap in meanings (specifically: tm_wday, tm_yday, tm_isdst);
the manpage should say which ones are used and which are ignored.  If any
combinations are required to be consistent, this also should be specified.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. man strftime
2.
3.

Actual results:


Expected results:


Additional info:
  The notes in http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html imply that the structure must be fully self-consistent, in
all its elements.

Comment 1 Siddhesh Poyarekar 2014-11-10 14:49:50 UTC
Man pages are a separate project.

Comment 2 Jan Chaloupka 2014-11-11 11:25:41 UTC
Hello Jeremy,

this will require some time inspecting glibc source files. Combination with gdb will make it faster. Can you list a couple of examples you would like to know more about? Will be sufficient to describe those three or you want all of them?

I can then use your examples in man page as important situation one should know about.

Kind regards
Jan

Comment 3 Jeremy Harris 2014-11-12 09:23:00 UTC
We need to specifically look at tm_wday, tm_yday and tm_isdst.  We can assume
that all the others are used.  I think I've seen a case where an uninitialized
tm_isdst resulted in odd output, but also I've had to run the results of
strptime() through mktime() (which recalculates these three) before feeding to
strftime().

Comment 4 Fedora End Of Life 2015-05-29 13:15:57 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Jeremy Harris 2015-05-29 13:25:35 UTC
Still missing in f21; updating Version

Comment 6 Nikola Forró 2015-07-07 15:24:06 UTC
Hello Jeremy,

which elements of tm structure are used depends on conversion specifications in the format string. For example %F uses tm_mday, tm_mon and tm_year, while %j uses tm_yday. We could describe in the manpage which elements each conversion specifier character uses - like here: http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html. We could also mention that users can call mktime() to make the tm structure consistent.

Let me know what you think.

Kind regards,
Nikola

Comment 7 Fedora Admin XMLRPC Client 2015-07-13 10:20:30 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Jeremy Harris 2015-07-24 14:25:14 UTC
(In reply to Nikola Forró from comment #6)

Yup; both of those things would be good.

If I had to nitpick the opengroup page, I didn't see an actual definition of their [ tm_<foo>] notation.  It's guessable but I think it should be actually
said.

Comment 9 Fedora End Of Life 2015-11-04 11:02:21 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Michael Kerrisk 2016-03-12 21:52:28 UTC
For the upcoming upstream release, man-pages-4.05, I've added information showing which 'tm' fileds are used to calculate each % specifier string output by strftime().

Comment 11 Nikola Forró 2016-03-14 11:55:58 UTC
Thanks Michael,

I'll backport the changes to F22 and F23.

Comment 13 Fedora Update System 2016-03-23 14:26:07 UTC
man-pages-4.04-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ae41a172c4

Comment 14 Fedora Update System 2016-03-23 14:26:59 UTC
man-pages-4.00-7.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7de4dea1ac

Comment 15 Fedora Update System 2016-03-23 14:27:43 UTC
man-pages-3.81-5.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bab047f46

Comment 16 Fedora Update System 2016-03-23 19:55:22 UTC
man-pages-4.04-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ae41a172c4

Comment 17 Fedora Update System 2016-03-24 01:00:37 UTC
man-pages-3.81-5.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bab047f46

Comment 18 Fedora Update System 2016-03-24 01:52:45 UTC
man-pages-4.00-7.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7de4dea1ac

Comment 19 Michael Kerrisk 2016-03-25 19:32:39 UTC
(In reply to Nikola Forró from comment #11)
> Thanks Michael,
> 
> I'll backport the changes to F22 and F23.

To repeat a point made elsewhere, backporting man-pages patches has no benefit; it has only costs.

Just push the latest man-pages release back to F22 and F23. Where pages document kernel or glibc features that are newer than the kernel or glibc in those releases isn't a problem: the pages always document the kernel glibc/version where a change took place. (This also handles issues such as the fact that a particular Fedora release may for example upgrade its kernel version later.)

Comment 20 Jeremy Harris 2016-03-29 10:59:34 UTC
(In reply to Michael Kerrisk from comment #19)
> To repeat a point made elsewhere, backporting man-pages patches has no
> benefit; it has only costs.

I disagree: it has benefit when the manpages were wrong or incomplete.

This is not a manpage change being done to match a software change, it is
a manpage change being done to match how the software always was.

Comment 21 Michael Kerrisk 2016-03-29 17:46:13 UTC
(In reply to Jeremy Harris from comment #20)
> (In reply to Michael Kerrisk from comment #19)
> > To repeat a point made elsewhere, backporting man-pages patches has no
> > benefit; it has only costs.
> 
> I disagree: it has benefit when the manpages were wrong or incomplete.
> 
> This is not a manpage change being done to match a software change, it is
> a manpage change being done to match how the software always was.

Just to be clear: I don't mean don't backport. But, I mean backport whole man-apges releases, not individual patches. The latter approach will lead to pain, and has no advantage over the former approach.

(See also https://bugzilla.redhat.com/show_bug.cgi?id=1083071#c11)

Comment 22 Fedora Update System 2016-03-29 19:33:51 UTC
man-pages-4.04-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2016-04-01 00:26:29 UTC
man-pages-4.00-7.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2016-04-02 04:17:07 UTC
man-pages-3.81-5.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.