public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/31413] FAIL: 22_locale/time_get/get_date/wchar_t/4.cc execution test
Date: Mon, 02 Apr 2007 02:36:00 -0000	[thread overview]
Message-ID: <20070402023606.13649.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31413-276@http.gcc.gnu.org/bugzilla/>



------- Comment #10 from dave at hiauly1 dot hia dot nrc dot ca  2007-04-02 03:36 -------
Subject: Re:  FAIL: 22_locale/time_get/get_date/wchar_t/4.cc execution test

> ------- Comment #8 from pcarlini at suse dot de  2007-04-02 00:53 -------
> One last remark: when something having to do with named locales doesn't work,
> often I find myself checking whether corresponding "C" code works. In this
> case, if __format is wrong, which means apparently that _M_data->_M_date_format
> is wrong, I suggest preparing a plain "C" snippet equivalent to the code in
> config/locale/gnu/time_members.cc which sets _M_data->_M_date_format, something
> like:
> 
>   loc = newlocale(1 << LC_ALL, __s, 0);
> 
>   union { char *__s; wchar_t *__w; } __u;
>   __u.__s = __nl_langinfo_l(_NL_WD_FMT, loc);
> 
>   const wchar_t* pp = __u.__w;

Thanks for the tip.  The following doesn't work on hppa but
does on x86:

#include <locale.h>
#include <langinfo.h>
#include <wchar.h>
wchar_t *
foo (void)
{
  char *__s = "zh_TW";
  wchar_t *pp;
  locale_t loc;
  union { char *__s; wchar_t *__w; } __u;

  loc = newlocale(1 << LC_ALL, __s, 0);
  __u.__s = nl_langinfo_l(_NL_WD_FMT, loc);
  pp = __u.__w;
  return pp;
}
int
main ()
{
  wchar_t *pp;
  pp = foo ();
  return 0;
}

Displaying the return value from the call to foo yields
(gdb) p ((wchar_t *)$ret0)[0]
$1 = 37

So, I think the problem is in nl_langinfo_l.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31413


  parent reply	other threads:[~2007-04-02  2:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-31 18:11 [Bug libstdc++/31413] New: " danglin at gcc dot gnu dot org
2007-03-31 18:49 ` [Bug libstdc++/31413] " danglin at gcc dot gnu dot org
2007-03-31 19:38 ` pcarlini at suse dot de
2007-04-01 20:36 ` dave at hiauly1 dot hia dot nrc dot ca
2007-04-01 22:24 ` pcarlini at suse dot de
2007-04-01 22:34 ` pcarlini at suse dot de
2007-04-01 23:16 ` dave at hiauly1 dot hia dot nrc dot ca
2007-04-01 23:31 ` pcarlini at suse dot de
2007-04-01 23:53 ` pcarlini at suse dot de
2007-04-01 23:55 ` pcarlini at suse dot de
2007-04-02  2:36 ` dave at hiauly1 dot hia dot nrc dot ca [this message]
2007-04-02  9:32 ` pcarlini at suse dot de
2007-04-22 16:47 ` dave at hiauly1 dot hia dot nrc dot ca
2007-04-22 16:50 ` pcarlini at suse dot de
2007-04-22 17:18 ` dave at hiauly1 dot hia dot nrc dot ca
2007-04-22 17:20 ` pcarlini at suse dot de
2007-04-22 17:24 ` pcarlini at suse dot de
2008-04-02 14:19 ` ghazi at gcc dot gnu dot org
2008-06-28  2:56 ` dtom77 at gmail dot com
2008-06-28  3:48 ` dave at hiauly1 dot hia dot nrc dot ca
2008-06-28  3:56 ` danglin at gcc dot gnu dot org
2010-02-05 16:55 ` ghazi at gcc dot gnu dot org
2010-02-05 17:04 ` paolo dot carlini at oracle dot com
2010-02-05 17:26 ` ghazi at gcc dot gnu dot org
2010-02-05 17:30 ` paolo dot carlini at oracle dot com

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=20070402023606.13649.qmail@sourceware.org \
    --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).