#17884 closed bug (fixed)

TMR: strftime conversion specifier failed during test

Reported by: cocobean Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: System/POSIX Version: R1/Development
Keywords: strftime Cc: davidkaroly
Blocked By: Blocking:
Platform: All

Description (last modified by cocobean)

TEST: Test case covering all the conversion specifiers that are supported in strftime().

Ref: conformance/interfaces/strftime/1-1.c

Expected Result: PASS

Actual Result: FAILED - (one of the tests failed with 'X Bytes 0 - Test Failed: %X doesn't equal a least 8 bytes')

Tested on Haiku hrev56376 x64 with Open POSIX Test Suite 1.5.2

Change History (9)

comment:1 by waddlesplash, 13 months ago

What happens with musl on Linux?

comment:2 by cocobean, 13 months ago

Description: modified (diff)

Update (2022-09-12): MUSL dev confirmed that MUSL passes these strftime tests on Linux.

Last edited 13 months ago by cocobean (previous) (diff)

comment:3 by cocobean, 13 months ago

Using LC_ALL=C, this causes test 2-1 to pass (failed before), but test 1-1 fails a different test now.

Test 1-1 now fails: "z Bytes 11 +4294966596 - Test Failed: %z doesn't equal at least 5 bytes"

Version 0, edited 13 months ago by cocobean (next)

comment:4 by cocobean, 13 months ago

Basically, with the default locale settings.

  1. Haiku hrev55181+67 x64: PASSED all three strftime POSIX tests. (TZ/GLIBC)
  2. Haiku hrev56417 x64: FAILED test 1-1 and 2-1 strftime POSIX tests. (MUSL)

On Haiku hrev56417 x64, setting LC_TIME=C fixed POSIX test 2-1 (i.e. test 2-1 now passes testing fully, but not 1-1 (i.e. test 1-1 still fails one minor test) on hrev56416 x64.

Per C99 compliance: The strftime function 
strftime provides a way of formatting the date and time in the appropriate locale-specific 
fashion using the %c, %x, and %X format specifiers. More generally, it allows the programmer to 
tailor whatever date and time format is appropriate for a given application. The facility is 
based on the UNIX system date command.

See §7.5 for further discussion of locale specification. For the field controlled by %P, 
an implementation may wish to provide special symbols to mark noon and midnight. 

A new feature of C99: C99 extends the strftime specifiers, introducing %C, %D, %e, %F, %g, 
%G, %h, %n, %r, %R, %t, %T, %u and %V, as well as the E and O modifiers. These specifiers were 
chosen according to existing practice to cover long-standing POSIX practice and to allow all the 
formatting available in ISO 8601.

Last edited 12 months ago by cocobean (previous) (diff)

in reply to:  4 comment:5 by korli, 13 months ago

Replying to cocobean:

Seems locale support is an open issue on MUSL wiki (https://wiki.musl-libc.org/open-issues.html):

Not sure why this would apply, given that we use ICU, for instance getShortMonths() and getMonths() to get the month names in a locale.

comment:6 by davidkaroly, 11 months ago

there seems to be a similar issue with strftime() in wxWidgets (both wxGTK and wxQT variants)

most likely %c, %x, %X are impacted.

comment:7 by davidkaroly, 11 months ago

Cc: davidkaroly added

comment:8 by cocobean, 10 months ago

Update: hrev56627 x86, TMR - strftime execution tests PASSED. Please close this ticket.

comment:9 by waddlesplash, 10 months ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.