public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification
@ 2020-07-11 4:13 erbenton at comcast dot net
2020-07-11 6:47 ` [Bug time/26226] " schwab@linux-m68k.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: erbenton at comcast dot net @ 2020-07-11 4:13 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=26226
Bug ID: 26226
Summary: strftime format string for 'day of the week' does not
recognize justification
Product: glibc
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: time
Assignee: unassigned at sourceware dot org
Reporter: erbenton at comcast dot net
Target Milestone: ---
Created attachment 12690
--> https://sourceware.org/bugzilla/attachment.cgi?id=12690&action=edit
C program demonstrating the issue
glibc 2.26 and 2.31 (x86_64)
strftime's format string %A does not recognize %-10A while %10A and %-A work as
expected
see attached sample program that demonstrates that there is no difference in
output between %10A and %-10A
Leaving out the width specifier (%A and %-A) produces the correct:
Saturday Jul 11, 8:59:44 pm
Saturday Jul 11, 8:59:44 pm
but including the width specifier produces the same string for %10A and %-10A
Saturday Jul 11, 8:57:42 pm
Saturday Jul 11, 8:57:42 pm
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug time/26226] strftime format string for 'day of the week' does not recognize justification
2020-07-11 4:13 [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification erbenton at comcast dot net
@ 2020-07-11 6:47 ` schwab@linux-m68k.org
2020-07-11 7:47 ` erbenton at comcast dot net
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: schwab@linux-m68k.org @ 2020-07-11 6:47 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=26226
Andreas Schwab <schwab@linux-m68k.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
The '-' flag is only valid for numeric formats.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug time/26226] strftime format string for 'day of the week' does not recognize justification
2020-07-11 4:13 [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification erbenton at comcast dot net
2020-07-11 6:47 ` [Bug time/26226] " schwab@linux-m68k.org
@ 2020-07-11 7:47 ` erbenton at comcast dot net
2020-07-11 8:27 ` fweimer at redhat dot com
2020-07-11 11:43 ` schwab@linux-m68k.org
3 siblings, 0 replies; 5+ messages in thread
From: erbenton at comcast dot net @ 2020-07-11 7:47 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=26226
Cat22 <erbenton at comcast dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |FIXED
--- Comment #2 from Cat22 <erbenton at comcast dot net> ---
That makes it different than the behavior of sprintf or printf.
Shouldn't it be desirable to try to conform to the same rules when possible?
Note that the "-" *is* recognized for %A even though you are correct the man
page claims it is only for numeric formats. It just does not recognize it when
there is a width value involved. Seems like this is also contra the man page -
either way this should be reconsidered and implemented as its worth doing imho.
Here's my reasoning:
1: It makes column alignment much easier
2: closer conformance with sprint/snprintf/printf format specifiers
3: The fix should be fairly easy (low resource requirements) considering the
basic code is available in the code for printf/sprintf and already implemented
for strftime with numerics
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug time/26226] strftime format string for 'day of the week' does not recognize justification
2020-07-11 4:13 [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification erbenton at comcast dot net
2020-07-11 6:47 ` [Bug time/26226] " schwab@linux-m68k.org
2020-07-11 7:47 ` erbenton at comcast dot net
@ 2020-07-11 8:27 ` fweimer at redhat dot com
2020-07-11 11:43 ` schwab@linux-m68k.org
3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-07-11 8:27 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=26226
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |security-
CC| |fweimer at redhat dot com
Resolution|FIXED |INVALID
--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
'-' is already used by another GNU extension, to suppress padding.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug time/26226] strftime format string for 'day of the week' does not recognize justification
2020-07-11 4:13 [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification erbenton at comcast dot net
` (2 preceding siblings ...)
2020-07-11 8:27 ` fweimer at redhat dot com
@ 2020-07-11 11:43 ` schwab@linux-m68k.org
3 siblings, 0 replies; 5+ messages in thread
From: schwab@linux-m68k.org @ 2020-07-11 11:43 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=26226
--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
strftime and printf formats are unrelated.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-11 11:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 4:13 [Bug time/26226] New: strftime format string for 'day of the week' does not recognize justification erbenton at comcast dot net
2020-07-11 6:47 ` [Bug time/26226] " schwab@linux-m68k.org
2020-07-11 7:47 ` erbenton at comcast dot net
2020-07-11 8:27 ` fweimer at redhat dot com
2020-07-11 11:43 ` schwab@linux-m68k.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).