public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/103687] [12 regression] several time/date failures after r12-5898
Date: Tue, 14 Dec 2021 11:41:26 +0000	[thread overview]
Message-ID: <bug-103687-4-2y6TBvthck@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103687-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103687

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On gcc110 (which is BE), I certainly can't reproduce the 3.cc failures you see.
All I see is (both -m32 and -m64):
+FAIL: 22_locale/time_get/get_time/char/2.cc execution test
+FAIL: 22_locale/time_get/get_time/char/wrapped_env.cc execution test
+FAIL: 22_locale/time_get/get_time/char/wrapped_locale.cc execution test
+FAIL: 22_locale/time_get/get_time/wchar_t/2.cc execution test
+FAIL: 22_locale/time_get/get_time/wchar_t/wrapped_env.cc execution test
+FAIL: 22_locale/time_get/get_time/wchar_t/wrapped_locale.cc execution test
and the reason for that is simple, old glibc.
On gcc110 with glibc 2.17 one gets:
LC_ALL=en_HK locale -k LC_TIME | grep _fmt | grep -v era
d_t_fmt="%A, %B %d, %Y %p%I:%M:%S %Z"
d_fmt="%A, %B %d, %Y"
t_fmt="%I:%M:%S %Z"
t_fmt_ampm="%p%I:%M:%S %Z"
date_fmt="%a %b %e %H:%M:%S %Z %Y"
While on glibc 2.32 I get:
LC_ALL=en_HK locale -k LC_TIME | grep _fmt | grep -v era
d_t_fmt="%A, %B %d, %Y %p%I:%M:%S"
d_fmt="%A, %B %d, %Y"
t_fmt="%I:%M:%S %p %Z"
t_fmt_ampm="%I:%M:%S %p %Z"
date_fmt="%A, %B %d, %Y %p%I:%M:%S %Z"

r12-5898 changed the testcase to match the recent glibc locale data:
https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=libstdc%2B%2B-v3/testsuite/22_locale/time_get/get_time/char/2.cc;h=a847748dc2716c7073bf7e6a2c5be8d1fefbf21c;hp=79f921d1cf6795e242f590cb8062a738c742884c;hb=c82e492616e343b6d6db218d2b498267bac899de;hpb=57b291c27ee7b2b2e6c04c37ec1b8f5bf87b99c4
previously it was failing on recent glibc and not on the old one.

One option to fix this would be custom locales where we don't have to chase
what exactly glibc of the day locales contain.
Another would be to use the non-standard _M_time_formats method on the
__timepunct facet of the locale, check what that string contains and based on
that decide what exactly to do in the test.
Another one would be to use the C APIs to query it (setlocale and nl_langinfo).

  parent reply	other threads:[~2021-12-14 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 15:26 [Bug libstdc++/103687] New: " seurer at gcc dot gnu.org
2021-12-13 15:28 ` [Bug libstdc++/103687] " seurer at gcc dot gnu.org
2021-12-13 17:06 ` redi at gcc dot gnu.org
2021-12-13 17:12 ` seurer at gcc dot gnu.org
2021-12-13 22:10 ` jakub at gcc dot gnu.org
2021-12-14 11:41 ` jakub at gcc dot gnu.org [this message]
2021-12-14 11:47 ` jakub at gcc dot gnu.org
2021-12-14 13:27 ` jakub at gcc dot gnu.org
2021-12-14 14:44 ` redi at gcc dot gnu.org
2021-12-14 14:46 ` redi at gcc dot gnu.org
2021-12-14 14:48 ` redi at gcc dot gnu.org
2021-12-14 16:15 ` redi at gcc dot gnu.org
2021-12-14 23:37 ` cvs-commit at gcc dot gnu.org
2021-12-14 23:39 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103687-4-2y6TBvthck@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).