Opened 2 years ago

Closed 2 years ago

#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, 2 years ago

What happens with musl on Linux?

comment:2 by cocobean, 2 years ago

Description: modified (diff)

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

Last edited 2 years ago by cocobean (previous) (diff)

comment:3 by cocobean, 2 years ago

Last edited 2 years ago by cocobean (previous) (diff)

comment:4 by cocobean, 2 years 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:

7.23.3.5 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 2 years ago by cocobean (previous) (diff)

in reply to:  4 comment:5 by korli, 2 years 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, 2 years 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, 2 years ago

Cc: davidkaroly added

comment:8 by cocobean, 2 years ago

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

comment:9 by waddlesplash, 2 years ago

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